JMS on demand poller
1. Overview
The JMS OnDemand Poller takes one message on demand from a queue, at the moment a message passes through it. To start a flow whenever a message arrives, use the JMS listener instead.
The poller reads queues only. The Studio also offers the TOPIC topology, but the poller then uses the topic name as the name of a queue and does not read from the topic. To receive messages from a topic, use a JMS listener with topic topology.
The message is put in the MessagePart named in MessagePart Out. If no message arrives within Receive Time-out, you choose what happens: the flow stops quietly, or a time-out message is sent further into the service chain.
2. Which messages it reads
| JMS message type | Result |
|---|---|
Text message |
The text is put in MessagePart Out as a text part. |
Binary message (BytesMessage) |
The bytes are put in MessagePart Out as a binary part, as the JMS listener does. |
Any other type, for example a map message, an object message or a message without a body |
The service stops with an error and the flow goes to the error flow. The error reads |
Since 5.3.1 a binary message is read, and a message of another type stops the service with an error. Before, such messages were removed from the queue and dropped without an error.
The JMS headers of the message and its own message properties are stored as properties of the MessagePart. A JMS header whose value cannot be stored there is skipped and mentioned in the log. A message property of that kind is skipped without a log entry.
|
The poller does not use a JMS transaction. As soon as it has received a message, that message is removed from the queue, also when the message is of an unsupported type and the flow fails, and also when a later step of the flow fails. A JMS Acknowledgement or JMS Rollback after the poller has no effect. If a message must not be lost when the flow fails, start the flow with a JMS listener in |
3. Receive time-out
The poller waits for a message for at most Receive Time-out milliseconds, and the flow waits with it. The default is 60000 (one minute). A value of -1 does not wait at all: if there is no message at that moment, the poller times out immediately. A value of 0 waits until a message arrives.
When the time-out expires without a message, the agent log shows a warning:
No Message received within timeout from destination: <destination>
What happens next depends on Time-out Message:
-
Time-out Message is empty: the poller sends nothing further and the flow stops at the poller, without an error.
-
Time-out Message has a value: that text is put in MessagePart Out and the flow continues. A later step cannot tell this text from a real message other than by its content, so choose text that you can test for, for example in a filter.
|
A message that takes longer to arrive than Receive Time-out, for example a large message over a slow connection, is not received completely. Set Receive Time-out higher than the longest transfer you expect, for example |
4. Properties
All attributes with a * are mandatory.
All attributes with a '** ' require exactly one of these properties having been set.
|
|
The older attributes Destination and Destination Reference are deprecated. Existing interfaces keep working. Use the request queue attributes in new interfaces.