uCosminexus Service Platform, Reception and Adapter Definition Guide
The method of defining Message Queue adapters is described here.
There are 2 types of messages in Message Queue adapters, namely request message and response message. The contents of each of these messages are described here.
For details on the procedure for creating a message format, see 4. Creating a Message Format in the manual Service Platform Basic Development Guide.
You can specify the XML format message or the binary format message in request and response messages of Message Queue adapters.
When sending a message in the XML format, you can specify only an XML format message. When sending a binary message, you can specify only a binary format message. Also, when receiving an XML format message, you can specify only an XML format message. When receiving a binary message, you can specify only a binary format message.
A message used to request sending of a message from a calling Message Queue adapter to the transmission queue and receiving of a message from the reception queue, is called as a request message.
The information to be sent as a request message is described here.
Table 3-26 Queue operation information
| Information | Description |
|---|---|
| Transmission queue-specific information, reception queue-specific information | Specify either the transmission queue or the reception queue to be accessed. Specify the name of resource-env-ref mentioned in the <resource-env-ref-name> tag, which is present in the <resource-env-ref> tag of HITACHI Application Integrated Property File. |
| Message correlation identifier | Specify this identifier, when receiving a message matching with the message correlation identifier, in case of a request to receive a message or a request to browse and receive a message. Specify the message correlation identifier, which is set at the time of the message transmission response within 24 bytes as a value. For details on the format of the message correlation identifier, see the description related to the method of generating message correlation identifier in 2.10.2 Access to message queue using Message Queue adapter in the manual Service Platform Overview. |
Mention only the required information in a request message, from among the information regarding the existence of the transmission queue-specific information and the reception queue-specific information, existence of the specifying message correlation identifier , and the sent message format (binary format or XML format).
For a request to send a message
The following table describes the request message format when specifying the transmission queue-specific information in the XML format:
Table 3-27 Format of the transmission request message in the XML format (when the destination queue-specific information is specified)
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Root element | SendRequest | - | Y |
| Header information | mqheader | - | Y |
| Transmission queue-specific information | sndresname | Transmission queue-specific information# | Y |
| Sent message | userdata | Optional to user | Y |
The following table describes the request message format, when you do not specify the transmission queue-specific information in the XML format:
Table 3-28 Format of the transmission request message in the XML format (when the destination queue-specific information is not specified)
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Root element | SendRequest | - | Y |
| Header information | mqheader | - | Y |
| Sent message | userdata | Optional to user | Y |
The case of specifying the transmission queue-specific information in the binary format is described here.
When sending a binary message, the request message format will be the binary format. The following figure shows the structure of a request message in the binary format:
Figure 3-17 Structure of the transmission request message in the binary format
The entire length of a message must satisfy the following relation:
LL >= 10 + Ln
The following table describes the information required for a request message, when sending a binary message:
Table 3-29 Format of the transmission request message in the binary format (when the destination queue-specific information is specified)
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Length of transmission queue-specific information | Specify the byte length in the transmission queue-specific information by using a decimal number and a string | 10 bytes | Y |
| Transmission queue-specific information | Transmission queue-specific information (string) | Optional | Y |
| Sent message | Optional to user | Optional | Y |
The following table describes the request message format, when you do not specify the transmission queue-specific information in the binary format:
Table 3-30 Format of the transmission request message in the binary format (when the destination queue-specific information is not specified)
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Sent message | Optional to user | Optional | Y |
For a request to receive a message
You cannot specify a request to receive a message in the binary format.
The following table describes the format of a request to receive a message in the XML format:
Table 3-31 Format of a request to receive a message in the XML format
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Root element | RecvRequest | - | Y |
| Header information | mqheader | - | Y |
| Reception queue-specific information | rcvresname | Reception queue-specific information#1 | N |
| Message correlation identifier | correlationid | Correlation identifier of a received message#2 | N |
For a request to browse and receive a message
You cannot specify a request to browse and receive a message in the binary format.
The following table describes the format of a request message used to browse and receive a message in the XML format:
Table 3-32 Format of a request message used to browse and receive a message in the XML format
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Root element | BrowseRequest | - | Y |
| Header information | mqheader | - | Y |
| Reception queue-specific information | rcvresname | Reception queue-specific information#1 | N |
| Message correlation identifier | correlationid | Correlation identifier of the received message#2 | N |
For a request to send and receive messages
The following table describes the request message format used when specifying the transmission queue-specific information and the reception queue-specific information in the XML format:
Table 3-33 Format of the request to send and receive messages in the XML format (when the transmission and reception queue-specific information is specified)
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Root element | SndRcvRequest | - | Y |
| Header information | mqheader | - | Y |
| Transmission queue-specific information | sndresname | Transmission queue-specific information# | Y |
| Reception queue-specific information | rcvresname | Reception queue-specific information# | Y |
| Sent message | userdata | Optional | Y |
The following table describes the request message format used when you do not specify the transmission queue-specific information and the reception queue-specific information in the XML format:
Table 3-34 Format of the request to send and receive messages in the XML format (when the transmission and reception queue-specific information is not specified)
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Root element | SndRcvRequest | - | Y |
| Header information | mqheader | - | Y |
| Sent message | userdata | Optional | Y |
The case of specifying transmission queue and reception queue-specific information in the binary format is described here.
When sending and receiving a binary message, the request message will be in the binary format. The following figure shows the structure of a request message in the binary format:
Figure 3-18 Structure of the message transmission and reception request in the binary format
The entire length of a message must satisfy the following relation:
LL >= 10 + Ln + 10 + Lo
The following table describes the information required for a request message when sending and receiving a binary message:
Table 3-35 Format of the transmission request message in the binary format (when the destination queue and the reception queue-specific information is specified)
| Tag name in a message | Specified value | Mandatory | |
|---|---|---|---|
| Length of transmission queue-specific information | Specify the byte length of the transmission queue-specific information using the decimal number and string | 10 bytes | Y |
| Transmission queue-specific information | Transmission queue-specific information (string) | Optional | Y |
| Length of receive-queue specific information | Specify the byte length of the reception queue-specific information using the decimal number and string | 10 bytes | Y |
| Transmission queue-specific information | Reception queue-specific information (string) | Optional | Y |
| Sent message | Optional to user | Optional | Y |
The following table describes the request message format used when you do not specify the transmission queue and the reception queue-specific information in the binary format:
Table 3-36 Format of the transmission request message in the binary format (when the destination queue and the reception queue-specific information is not specified)
| Information | Tag name in a message | Specified value | Mandatory |
|---|---|---|---|
| Sent message | Optional to user | Optional | Y |
A message that is returned to the invoker of Message Queue adapter is called as response message. The information returned as a response message is described here.
The contents of a response message differ according to the format of a received message (binary format or XML format).
Note that you cannot specify a response for message transmission in the binary format.
The format of the transmission response message in the XML format is as follows:
In case of a response message for a request to send a message
The following table describes the format of the transmission response message in the XML format:
Table 3-37 Format of the transmission response message in the XML format
| Information | Tag name in a message | Return value |
|---|---|---|
| Root element | SendResponse | - |
| Result of message transmission | status | OK |
| Message correlation identifier | correlationid | Message correlation identifier# |
In case of a response message for a request to receive a message
The following table describes the format of a response message for receiving messages in the XML format:
Table 3-38 Format of a response message for receiving messages in the XML format
| Information | Tag name in a message | Return value |
|---|---|---|
| Received message | Optional to user | Optional to user |
The following table describes the format of a response message for receiving messages in the binary format:
Table 3-39 Format of a response message for receiving messages reception in the binary format
| Information | Tag name in a message |
|---|---|
| Received message | Optional to user |
In case of a response message for a request to browse and receive a message
The following table describes the format of a response message for a request to browse and receive a message in XML format:
Table 3-40 Format of a response message for a request to browse and receive a message in XML format
| Information | Tag name in a message | Return value |
|---|---|---|
| Received message | Optional to user | Optional to user |
The following table describes the response message for a request to browse and receive a message in the binary format:
Table 3-41 Format of a response message for a request to browse and receive a message in the binary format
| Information | Tag name in a message |
|---|---|
| Received message | Optional to user |
Response message for a request to send and receive a message
The following table describes the format of a response message for a request to send and receive a message in the XML format:
Table 3-42 Format of a response message for a request to send and receive a message in the XML format
| Information | Tag name in a message | Return value |
|---|---|---|
| Received message | Optional to user | Optional to user |
The following table describes the format of a response message for a request to send and receive a message in the binary format:
Table 3-43 Format of a response message for a request to send and receive a message in the binary format
| Information | Tag name in a message |
|---|---|
| Received message | Optional to user |
From among the various message formats, the message format set up in a service component is the message format of a Message Queue adapter. The method of creating the message format of a Message Queue adapter is described here.
When the user creates the definition file on his own
When the case is other than the above-mentioned case of using the XML format definition template file and the case of using the file provided with the product, the user must create the definition file on his own.
The following figure gives a description on the XML format definition template file and customization:
Figure 3-19 Template file for a request to send a message (adpmq_snd_request.xsd)
Table 3-44 Contents of the template file for a request to send a message
| Line number | Description |
|---|---|
| 4th line | Indicates name space declaration of this template file. The user declares any prefix in the value of targetName space attribute specified in the 6th line. |
| 6th line | Indicates the target name space of this template file. The user specifies a unique target name space in the value of targetName space attribute. |
| 8th line | When importing the XML schema information for the user data on the 25th line, mention the target name space of the schema to be imported in the 5th line and mention import statement of the schema to be imported in the 8th line. |
| 10th line~16th line | Indicates declaration of SendRequest element. These lines contain mqheader element and userdata element which becomes the root element of a request message. The user describes the prefix declared in the 4th line as the prefix of mqheader element and userdata element. |
| 18th~22nd line | Indicates declaration of mqheader element. |
| 24th line | Indicates declaration of userdata element. |
| 25th line | Describes the XML schema information for the user data.
|
Figure 3-20 Format definition template file for a request to send and receive a message (adpmq_sndrcv_request.xsd)
Table 3-45 Contents of the template file used for a request to send and receive a message
| Line number | Description |
|---|---|
| 4th line | Indicates name space declaration of this template file. The user declares any prefix in the value of targetName space attribute specified in the 6th line. |
| 6th line | Indicates the target name space of this template file. The user specifies a unique target name space in the value of targetName space attribute. |
| 8th line | When importing the XML schema information for the user data on the 26th line, mention the target name space of the schema to be imported in the 5th line and mention import statement of the schema to be imported in the 8th line. |
| 10th line~16th line | Indicates declaration of SndRcvRequest element. These lines contain mqheader element and userdata element which becomes the root element of a request message. The user describes the prefix declared in the 4th line as the prefix of mqheader element and userdata element. |
| 18th line~23rd line | Indicates declaration of mqheader element. |
| 21st line | Indicates the specified element of reception queue-specific information. This specification location differs from the template file for a request to send a message. |
| 25th line | Indicates declaration of userdata element. |
| 26th line | Describes the XML schema information for the user data.
|
Response message in the binary format
The following are the cases with respect to binary format definition file for a response message. However, the user should create the binary format definition file on his own.
Set the message format definition file of the transformation source and the message format definition file of the transformation destination on the data transformation (mapping) definition screen and define the data transformation.
For details on how to define data transformation, see 6. Defining Data Transformation in the manual Service Platform Basic Development Guide.
The procedure for defining a Message Queue adapter is described here. For details on the setting contents, see 3.3.15(7) For Message Queue adapters.
Define the information required for the environment definition of a Message Queue adapter in the Message Queue adapter environment-definition file in XML format.
The procedure for editing the Message Queue adapter environment-definition file is as follows:
Define the information required for the communication-configuration definition of a Message Queue adapter in the Message Queue adapter communication-configuration definition file in the XML format.
The procedure to edit the Message Queue adapter communication-configuration definition file is as follows:
The method of editing the HITACHI Application Integrated Property File is described here.
The procedure for editing the HITACHI Application Integrated Property File is as follows:
The contents of the HITACHI Application Integrated Property File are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hitachi-application-all-property PUBLIC
'-//Hitachi, Ltd.//DTD Application All Property 7.6//EN' 'http://localhost/hitachi-application-all-property_7_6.dtd'>
<!-- All Rights Reserved. Copyright (C) 2008, Hitachi, Ltd. -->
<hitachi-application-all-property>
<hitachi-application-property>
<lookup-name>CSCMQ</lookup-name>
<security-prop>
<security-method>no_security_for_methods_without_roles</security-method>
</security-prop>
<managed-by-ctm>false</managed-by-ctm>
</hitachi-application-property>
<ejb-jar>
<hitachi-ejb-jar-property>
<display-name>CSCMsgServiceAdapter</display-name>
</hitachi-ejb-jar-property>
<hitachi-session-bean-property>
<display-name>CSCMsgServiceAdapterEJB</display-name>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>jms/resource adapter-specific information</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
<linked-to>name displayed for resource adapter</linked-to>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>transmission queue-specific information or reception queue-specific information</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
<linked-adminobject>
<resourceadapter-name> name displayed for resource adapter</resourceadapter-name>
<adminobject-name>name of the admin object</adminobject-name>
</linked-adminobject>
</resource-env-ref>
<container-transaction>
<description></description>
<method>
<description></description>
<method-intf></method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<session-runtime>
<lookup-name>CSCMsgServiceAdapterEJB</lookup-name>
<optional-name></optional-name>
<maximum-sessions>0</maximum-sessions>
<stateless>
<pooled-instance>
<minimum>minimum number of instances</minimum>
<maximum>maximum number of instances</maximum>
</pooled-instance>
</stateless>
</session-runtime>
</hitachi-session-bean-property>
</ejb-jar>
</hitachi-application-all-property>
|
Setup value of the definition is described here.
For details on the HITACHI Application Integrated Property File, see the following sections:
You must create Message Queue adapter runtime-environment property file for Message Queue adapter.
For details on the Message Queue adapter runtime-environment property file, see Message Queue adapter runtime-environment property file in the manual Service Platform Reference Guide.
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.