Syntax

	jmsSend($destination, $message)

Description

This function is used to send messages to a queue or a topic. The Java internal JMS API (Java Message Service / Jakarta Messaging) is used for this purpose, which allows messages to be sent to a server and retrieved synchronously or asynchronously from the server.

In order for a message to be sent, a target configuration must be created in the JMS service. The queue manager defined in the configuration must be reachable at the specified address in order to succeed in sending, otherwise an error is issued. IBM MQ, for example, can be used as the server here. This must have been created and started separately.

All target configurations can be viewed, created, edited and deleted under Administration > Development > Service Editor > JMS Service , provided the user has the appropriate permissions.

Parameters

Name Type Description Mandatory Default
destination Character string (target configuration) Name of a target configuration in the JMS service yes -
message number/string/binary data/XML message to be sent to a queue or topic yes -

return value

null - since no return is made when sending a message.

Examples

String message (Topic)

	jmsSend("Topic1", "Hello Subscribers!");

New message (in the topic of the queue manager): Hello Subscribers!

This expression sends the message Hello Subscribers! to the topic set in the configuration with the name "Topic1".

String Message (Queue)

	jmsSend("Queue1", "Hello World!");

New message (in the queue of the queue manager): Hello world!

This expression sends the message Hello World! to the queue specified in the configuration with the name "Queue1".

XML Message (Queue)

	jmsSend("Queue1", {{{<div>Hello World!</div>}}});

New message (in the queue of the queue manager).: <div>Hello World!</div>

This expression sends the XML expression <div>Hello World!</div> to the queue specified in the configuration with the name "Queue1".

Binary data message (queue)

	jmsSend("Queue1", binary(
    name: "hello.txt",
    data: "Hello Wörld!",
    contentType: "text/plain",
    encoding: "iso-8859-1"
));

New message (in the queue of the queue manager).: Binärnachricht

This expression sends the binary data binary(name: "hello.txt", data: "Hello Wörld!", contentType: "text/plain", encoding: "iso-8859-1") to the queue specified in the configuration with the name "Queue1".