9.48.6 JMS Request Agent
The JMS Request agent sets up a publishing session to the destination that is specified in the profile.
The JMS Request agent uses JNDI to connect to a JMS server. Depending on the type in the the Request field, a JMS Message of the appropriate type is sent. For a list of supported types see 9.48.4 JMS Cycle.
The message is then sent to the specified destination. While in session, the agent creates either a temporary queue or a temporary topic and sets up a consumer for it. If the getResponse
field is set to true
, the agent expects a reply from the temporary destination. The JMSCycle
is then saved in a local cache and sent to the JMS Server. When the reply arrives, the correlation ID of the message is used to match the incoming JMS message with the correct JMSCycle
in the local cache. When found, the JMSCycle
is removed from the cache and the response field is set to the incoming JMS message. Then the JMSCycle
UDR is inserted into the workflow.
If the JMS Request agent encounters a connection failure the agent tries to re-establish the connection with the JMS server. If the agent has not managed to re-establish the connection to the JMS server after five attempts, it will instead try to re-establish the connection for each UDR.
Note!
A property can be set to get the JMS Request agent to connect and acquire a Connection Factory object and a Destination object from a JNDI service for every connection attempt. To enable this, add the following property to the relevant EC/ECSAs using the mzsh topo
command:
mzsh topo set topo://container:<container>/pico:<ec name>/val:config.properties.mz.jms.reinitialize true
If no response is expected, as getResponse
is false
, the agent sends the request content to the JMS server and discards the UDR. If the send operation fails, the UDR is inserted once again into the workflow with the status set to 30
or 31
.
If a reply is not received within the specified timeout, the JMSCycle
UDR is forwarded with the Response field set to NULL
and the status set to 20
.
This section contains the following subsections:
9.48.6.1 JMS Request Agent Configuration