uCosminexus Service Platform, Overview
You can use Message Queue reception to invoke a business process from JMS provider message queue (IBM WebSphere MQ) through MQ resource adapter.
The following figure shows the flow of service component invocation using Message Queue reception:
Figure 2-56 Invoking a service component from JMS provider (message queue) using Message Queue reception
Message Queue reception receives request messages through MQ resource adapter. Message Queue reception receiving a service component execution request invokes the business process and executes all types of service components through the service adapter.
Use MDB (Message-Driven Bean) to receive a request message.
A response message is not returned from Message Queue reception.
Use WebSphere MQ (manufactured by IBM) as JMS provider in Message Queue reception. WebSphere MQ is asynchronous communication infrastructure of message queueing type for data communication between system programs of different models.
Message Queue reception is supported in WebSphere MQ version 7.5.
The following figure shows WebSphere MQ configuration:
Figure 2-57 WebSphere MQ configuration
You can specify the send option (JMS header and properties) to send messages. The following shows details of send options of Message Queue reception:
All setting values of the send option (JMS header) are transformed to String type and are set in the header message. At this stage, if value is null or blank, the tag is blank.
The following table describes the details of JMS header:
Table 2-8 Details of JMS header
Header name | Setting contents | Setting time | Possibility of setting in client |
---|---|---|---|
JMSDestination | Queue name in which message is registered | Set when QueueSession.createSender(Queue queue) method is issued. | N |
JMSDeliveryMode | Value showing message persistence | Set when the message is sent. | N |
JMSMessageID | Message identifier to uniquely identify each message sent by the provider | Set when the message is sent. | N |
JMSTimestamp | Value showing message sending time (unit: milliseconds) | Set when the message is sent. | N |
JMSExpiration | Value showing time for which message is valid (unit: milliseconds) | Set when the message is sent. | N |
JMSRedelivered | Value showing whether the message is being redelivered | Set when a message delivered to the application needs to be redelivered by recovery. | N |
JMSPriority | Message priority | You can specify by QueueSender.setPriority() method, or QueueSender.send() method. | Y |
JMSReplyTo | Response destination address | Set when Message.setJMSReplyTo() method is issued. | Y |
JMSCorrelationID | Correlation identifier to correlate a message to another message | Set when Message.setJMSCorrelationID() method is issued. | Y |
JMSType | Message type provided by the application when a message is sent | Set when Message.setJMSType() method is issued. | Y |
Message properties are configured from the properties set by JMS provider and properties that the user can set in the client.
Table 2-9 List of JMS standard properties
Item name | Description |
---|---|
JMSXUserID | User ID of message sender |
JMSXAppID | ID of message sending application |
JMSXDeliveryCount | Number of times a message is re-received |
JMSXGroupID | ID of group to which the message belongs |
JMSXGroupSeq | Message order number in the group |
JMSXProducerTXID | Transaction identifier |
JMSXConsumerTXID | Transaction identifier |
JMSXRcvTimestamp | Message reception time |
JMSXState | Item used in the provider |
Table 2-10 List of data types you can set in a property
Data type | Setting method |
---|---|
Boolean | setBooleanProperty(String name, boolean value) |
Byte#1 | setByteProperty(String name, byte value) |
Short | setShortProperty(String name, short value) |
Integer | setIntProperty(String name, int value) |
Long | setLongProperty(String name, long value) |
Float | setFloatProperty(String name, float value) |
Double | setDoubleProperty(String name, double value) |
String | setStringProperty(String name, String value) |
Object#2 | setObjectProperty(String name, Object value) |
MQ resource adapter is used for passing messages from JMS provider (IBM WebSphere MQ system) to Message Queue reception.
The connection relation between MQ resource adapter and Message Queue reception is that you can correlate multiple receptions for 1 resource adapter but you cannot correlate multiple resource adapters for 1 reception.
Specify the correlation of MQ resource adapter and Message Queue reception in Message Queue reception definition file. The specified contents are enabled when Message Queue reception starts. At this stage, you must start MQ resource adapter in advance, which is correlated with Message Queue reception. Setting contents of Message Queue reception are not enabled, since Message Queue reception cannot start if the correlated MQ resource adapter is not started.
The connection relation between Message Queue reception and MQ resource adapter is described here.
You can set up one of the following connection relations:
The following figures show the examples:
(Example 1) If connection relation between resource adapter and reception is 1:1
(Example 2) If connection relation between resource adapter and reception is 1:n
You cannot set n:1 configuration for connection relation between the resource adapter and reception, since you cannot specify multiple resource adapters for 1 reception.
The following figure shows an example:
(Example)
Queue is a queue object compiling JMS objects and is managed by the queue manager.
The connection relation between a queue and Message Queue reception is that multiple receptions can correlate to 1 queue but multiple queues cannot correlate to 1 reception.
The connection relation between Message Queue reception and queue is described here.
You can set up one of the following connection relation:
The following figures show the examples:
(Example 1)If connection relation between a queue and reception is 1:1
(Example 2)If connection relation between a queue and reception is 1:n
You cannot set up n:1 configuration for connection relation between a queue and reception, since you cannot specify multiple queues for 1 reception.
(Example 1)If there is 1 queue manager
(Example 2)If there are multiple queue managers
While creating a business process, you must match the receive activity communication model with the communication model of Message Queue reception.
You can set business process persistence as persistent or non-persistent.
However, please note that if you set non-persistent, there may be duplicate message delivery when a fault occurs.
The connection relation between a business process and Message Queue reception is that multiple receptions can correlate to 1 business process but multiple business processes cannot correlate to 1 reception.
The connection relation between Message Queue reception and business processes is described here.
You can set up one of the following connection relations:
The following figures show the examples:
(Example 1)If connection relation between a business process and reception is 1:1
(Example 2)If connection relation between a business process and reception is 1:n
You cannot set up n:1 configuration for connection relation between a business process and reception, since you cannot define multiple business processes for 1 reception.
The following figure shows an example:
(Example)
You can configure various systems according to the communication model used in Message Queue reception.
Configuration examples in the following cases are explained here.
You must use transactions same as those of WebSphere MQ queue manager, since the queue rolls back when an exception occurs in Message Queue reception. For this, use a container management transaction for Message Queue reception transaction. By this, the transaction is committed at the same time as when WebSphere MQ queue is committed.
The following figure shows the range of transactions performed when Message Queue reception is used:
Figure 2-58 Range of transactions performed when Message Queue reception is used
Message Queue reception is processed by using transactions same as those of WebSphere MQ queue manager. However, the business process is processed by transactions different from WebSphere MQ queue manager. Due to this, the process terminates abnormally in Message Queue reception and even when the message returns to the beginning of the queue to execute rollback, the business process transaction might end normally. In this status, if the message is resent by rollback, the same process is re-executed in the business process in which the process was executed once. To prevent such processes, perform a process to prevent duplicate delivery of messages. To prevent duplicate delivery of messages, see "(8) Preventing duplicate message delivery while using Message Queue reception".
If the request process ends abnormally, the business process for which the process is executed once is reprocessed when the message to execute rollback returns to the beginning of the queue and the message is resent.
Perform settings for preventing duplicate message delivery in Message Queue reception. With these settings, you can prevent re-execution of a business process that is already executed due to resending of a message.
If all the following conditions are met, check prevention duplicate delivery:
The points to be considered when prevention of duplicate delivery is set are as follows:
Examples of the main faults occurring in business processes and the operations and actions to be performed when prevention of duplicate delivery is set are described here.
Always roll back if a fault occurs during the request process in Message Queue reception. This is to prevent unlimited loops by moving messages to the queue specified in the dead letter queue of the queue manager or the back out re-queue of the queue.
Set the number of rollbacks in WebSphere MQ queue manager and the queue.
For details on the setting methods, see WebSphere MQ manual.
Table 2-11 Setting item correlated to rollback set in the queue manager
Setting item | Setting contents | Value that can be set | Default value |
---|---|---|---|
DEADQ | Dead letter queue name | Queue name | SYSTEM.DEAD.LETTER.QUEUE |
Table 2-12 Setting items correlated to rollback set in queue
Setting item | Setting contents | Value that can be set | Default value |
---|---|---|---|
BOTHRESH | Backout threshold value | 0-999999999 | 0 |
BOQNAME | Backout re-queue name | Queue name | None |
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.