Navigation: Developing Apps > BINETIX® AGE™ API > Plugins > IMQ Controller > Modules > imq
publish/5
Description
publish/5 is an Erlang function exported by "imq" module.
Publishes a message to a topic. As a result, the IBM MQ manager will broadcast this message to all subscribtions to that topic.
References
•subscribe/5
•put_request/5
Parameters
Name
Type
Manager
string()
Name of registered MQ manager.
Target
Path to a Topic and its resources.
Data
binary()
Data block to be send into the Queue as a message.
Fields
list()
List of message control fields. Refer to put_request/5 for more details.
Timeout
integer()
Optional. Execution timeout in milliseconds. Defaults to ?IMQ_REQUEST_TIMEOUT
Result
Value or Type
{ok, Code}
On success returns a control code.
Code Sample
> publish("LIBREE", "LIBREE.NOTIFY", <<"Some notification message...">>, [
{message_format, ?IMQ_MQFMT_NONE},
{message_type, ?IMQ_MQMT_DATAGRAM},
{message_datetime, age_tools:now_to_iso8601()}
]).