CALLJEE Message Processing in TAFJ
This section illustrates the processing of complex and simple messages.
You can send a message only when there is a Queue context. A Queue context includes the following details - JMS connection factory, destination queue name, reply queue name, JMS Connection, JMS session, user name and password.
It is possible to instruct TAFJ to cache the JMS Queue context by using the property temn.tafj.calljee.cache. By default, this property is set to false.
- When the property temn.tafj.calljee.cache is set to true, the Queue context per session is initialised for the first time, cached and the same is retrieved during successive calls within the same session.
- When the property temn.tafj.calljee.cache is set to false, the Queue context is initialised every time when CALLJEE is invoked, irrespective of the sessions invoking CALLJEE, which results in a relatively higher performance overhead.
If the connection factory is null, then the default connection factory java:comp/env/jms/TAFJQueueConnectionFactory is considered for processing the message. In case of simple message, messages are sent as single message and no responses are received.
The following are the permitted values for jmsDestionation and message.
Processing a Complex Message
When the messages have more than 10 fields (separated by @FM) as per TOCFEE specification, they are considered as complex messages.
- Field 1 – It specifies the message type.
- Field 2 – It is an optional field and holds correlation ID prefix. Its default value is CALLJEE.
- Field 3 – It specifies sync mode and possible values are null, SYNC and RECEIVE.
- If SYNC mode is specified, then reply queue must be specified. Message is sent from the mentioned queue and responses are received in reply queue.
- If RECEIVE mode is specified, then messages cannot be sent and only response is received in the mentioned queue.
- In case of null (ASYNC mode), only messages are sent and no response is received.
- Field 4 – It specifies expiry time for messages. For SYNC mode, default timeout is 30s and can be overridden. This field is applicable for SYNC and RECEIVE modes.
- Field 5 – It specifies received message properties and set of key-value pair.
- Field 6 – It is an optional field with Guarded Queue parameters. Here, queue name and expiry time is separated by @VM.
When guarded queue is used, messages are sent to guarded queue and then to the destination. Messages are held in the guarded queue until the expiry time given in field 6. During this time, messages with same correlation IDs cannot be re-sent to the guarded queue.
In case of SYNC and RECEIVE mode, responses are received in the reply queue and in the mentioned queue respectively.
Processing simple message
When the message has less than 10 fields (separated by @FM), as per TOCFEE specification, message is considered as a simple message.
When a simple message is passed as part of CALLJEE, Queue context is initialised and message is sent to the destination. In this case, no response is received.
In this topic