Using Activity Implementor JMS Adapter
The class
com.centurylink.mdw.workflow.adapter.jms.JmsAdapter
implements an adapter activity that can be used to send JMS messages.
The adapter is intended for both asynchronous messages (sending messages only - using
another event wait activity to receive the responses if they are expected)
and synchronous messages (sending messages and waiting for responses in the same
activity).
Attributes
The following attributes are used by this implementor:
- Request Variable. This is a variable name. The request message sent to external
system is taken from the value of this variable.
- Response Variable. This is a variable name that will receive the response message,
when the adapter is synchronous (Wait for response is true). It is ignored when
the adapter is asynchronous.
- Wait for response. When it is true, the adapter is synchronous, meaning it is waiting
for a response; when it is false, the adapter is asynchronous, meaning it sends the message
and moves on to the next activity.
- Log req/resp. This is a Boolean flag to turn on or off logging of messages
to and from the external systems. The messages are logged in the database table DOCUMENT.
- Server URL. This attribute specifies the URL of the receiving (remote) JNDI server.
An example is
tcp://localhost:7001
. More than likely, the value is
deployment specific (different between development, testing and production environment).
So it is typically specified using properties using the MDW binding expressions syntax
#{props['my.jms.url']}
.
- Queue Name. This specifies the receiving (remote) queue name.
- Reply Queue Name. This specifies a local queue name to receive the response.
When the adapter is synchronous (Wait for response is true), this is typically
left blank, and the engine will generate a temporary queue to recevie the response.
When the adapter is asynchronous or certified, meaning a wait activity later on will wail for
the response, this should typically be
the external event queue (named
com.centurylink.mdw.external.event.queue
)
so that the standard listener and external event handler mechanism can be used.
If an application specific JMS queue is needed, the handling of the response messages
will be completely up to the application specific code.
- Correlation ID. If an asynchronous response is expected, or the message is an asynchronous response
to an asynchronous external message, the correlation ID may need to be specified.
The value of the attribute can contain Expressions
(e.g. "${variables['myVar']}").
Extending the Implementor
If your customization needs cannot be completely met by
the attributes above, you can consider subclassing this implementor.
Refer to this link
for description of overridable methods.
Additionally, you can override the methods implemented
in this class, which include:
getQueueName
getRequestData
invoke
openConnection
closeConnection
Refer to the class's
javadoc for more details.