uCosminexus Service Platform, Overview

[Contents][Glossary][Index][Back][Next]

2.10.2 Access to message queues using Message Queue adapter

The following figure shows sending and receiving of messages by Message Queue adapter:

Figure 2-59 Execution of sending and receiving of messages by Message Queue adapter

[Figure]

Note
  • Message Queue adapter executes the connection release process for each request from the business process. However, actually, the connection between fixed time (default 5 minutes) resource adapter and WebSphere MQ is not disconnected by the resource adapter connection pool functionality.
    This depends on the specification in Connector attribute file (default is not disconnected).
  • If connection release fails in the connection release process, Message Queue adapter is in connection release status. However, connection release might not be detected in the connection destination JMS provider system. This causes inconsistency in the connection status and the next communication process might fail. In such cases, it is necessary to support 1 initialization of connection establishment status in the connection destination JMS provider system.
Organization of this subsection
(1) Send option of Message Queue adapter
(2) Method of generating message correlation identifier
(3) Transactions to be performed while using Message Queue adapter

(1) Send option of Message Queue adapter

The message sending functionality of Message Queue adapter sets connection and sessions with JMS provider through the resource adapter according to the send message request from the business process. It also sends messages to JMS provider.

The message types you can send are XML format messages and binary format messages. However, even if the sent message is in XML format, it is stored as a binary format message in the sending queue.

You can specify the send option (JMS provider) while sending messages. The following table describes the list of send options of Message Queue adapter:

Table 2-13 List of send options of Message Queue adapter

Item Overview of send option Specification method
Message Definition
Message sending destination
(JMSDestination)
Message sending queue. Y Y
Message maintenance time
(JMSExpiration)
Message maintenance time. Message maintenance time refers to the time of continuous maintenance in the sending queue of JMS provider. N Y
Message persistence
(JMSDeliveryMode)
Message persistence. Message persistence refers to specification of whether to maintain a message in the queue after a system fault or when JMS provider is restarted. N Y
Message identification ID
(JMSMessageID)
ID to identify a message.
Any information is set if WebSphere MQ Resource Adapter is used.
- -
Time stamp
(JMSTimestamp)
Message time stamp. - -
Report message sending destination
(JMSReplyTo)
Report message sending queue. N N
Message type
(JMSType)
Message type. N Y
Correlation identifier
(JMSCorrelationID)
Correlation identifier of message. N A
Priority
(JMSPriority)
Message priority. 4 is set in WebSphere MQ Resource Adapter. - -

Legend:
Specification method:
Message: Existence of specification according to the request message from the business process.
Definition: Existence of specification according to communication configuration definition file of Message Queue adapter.
Y: Can be specified.
A: You can only specify the prefix of the message correlation identifier.
Message Queue adapter is auto-generated while sending a message correlation identifier.
N: Cannot be specified.
-: Message Queue adapter is not set. It is dependent on resource adapter specifications.

For details on sending of messages by setting the message correlation identifier, see "2.10.2(2) Method of generating message correlation identifier".

The following figure gives an overview of the message sending functionality:

Figure 2-60 Message sending functionality

[Figure]

  1. Message Queue adapter receives a message sending request from the business process and connects the connection.
  2. After connection, a session is set with the sending queue.
  3. Execute the message sending request and store the message in the sending queue. If you specify the send option in the communication configuration definition file of Message Queue adapter, the send option is set and the message is sent.
  4. Release the session after message sending is finished.
  5. Disconnect the connection with JMS provider.
    After the connection is disconnected, return the message sending response to the business process.

(2) Method of generating message correlation identifier

If Type2 is specified in the <id_type> tag of the communication configuration definition file of Message Queue adapter, Message Queue adapter automatically generates the message correlation identifier and provides it to the sent message.

Message correlation identifier is configured from the prefix and Message Queue adapter-specific information. There are 2 methods namely, when the generation method of message correlation identifier provides the prefix and when it does not provide a prefix.

Message Queue adapter-specific information is set by Message Queue adapter.

(a) When there is no prefix

There is no prefix provided in the message correlation identifier when there is no specification in <JMSCorrelID_PFX> tag.

In such cases, the first 6 bytes have 0 (zero) padding and the message correlation identifier matches with the Message Queue adapter-specific information.

Figure 2-61 Method of generating message correlation identifier (without prefix)

[Figure]

(b) When there is a prefix

If the message correlation identifier is provided with a prefix and if the <JMSCorrelID_PFX> tag is specified, the <JMSCorrelID_PFX> tag value is a part of the message correlation identifier. You can specify a maximum of 6 bytes for the prefix. However, if the prefix is less than 6 bytes, there is 0 (zero) padding from the beginning to make the prefix 6 bytes. For example, if the specified value of the <JMSCorrelID_PFX> tag is "ABC", "000ABC" is set in the prefix part.

This prefix and Message Queue adapter-specific information match to form the message correlation identifier.

Figure 2-62 Method of generating message correlation identifier (with prefix)

[Figure]

Reference note
If message sending fails when the message correlation identifier is set, you can specify the sent message and message correlation identifier from data trace.

(3) Transactions to be performed while using Message Queue adapter

For the transaction support level provided in the resource adapter, specify "LocalTransaction" or "XATransaction". However, you can only specify "LocalTransaction" when business process status is not persistent. You cannot specify "NoTransaction".

If you specify "LocalTransaction" or "XATransaction", correlation occurs with JTA (Java Transaction API). For example, if the specified value of JTA transaction timeout is shorter than the message reception response monitoring time (receive_timeout) of the communication configuration definition file of Message Queue adapter, timeout occurs in the specified value of JTA transaction timeout.

If a request to receive messages or a request to send and receive messages is received from the business process, Message Queue adapter issues a request to receive messages. If the resource adapter cannot receive the message of this request to receive messages within the fixed time, timeout of the message reception response monitoring time occurs in the resource adapter. Message Queue adapter notifies the business process about fault response information according to the notification from the resource adapter. Moreover, a request to browse and receive a message is received from the business process and this request is made. However, even if the message does not exist in the reception queue, the business process is notified about fault response information.

For details on defining the process to be followed when a fault occurs, see "5.4.3 Defining Fault Handling" in "Service Platform Basic Development Guide" .