Adapter requests and responses for the JMS adapter
When you use a context item as an input for an adapter request, you must enclose the adapter request in the <request-data> elements. However, when you create a static request, <request-data> is not required and the adapter request starts with the <adapterName-adapter-request> element.
The JMS adapter supports the following types of messages:
- TextMessage: Contains string messages that are used for exchanging textual data and complex character data like XML
- MapMessage: Contains name-value pairs
- BytesMessage: Contains a stream of uninterrupted bytes
The messages support the following type of values in the <value> tag of the JMS adapter request:
- String
- Integer
- Float
- Long
- Short
- Boolean
- Byte
- Double
The following table describes the elements of a JMS adapter request.
Elements of a JMS actor adapter request
The following figure shows an XML template for the JMS actor adapter request.
XML template of the JMS actor adapter request
<reply-to></reply-to>
<expiration></expiration>
<priority></priority>
<correlation-id></correlation-id>
<jms-type></jms-type>
<delivery-mode></delivery-mode>
<dest></dest>
<character-set>Shift_JIS</character-set>
<request-response-wait-timeout></request-response-wait-timeout>
<properties>
<property>
<name></name>
<value type="Integer"></value>
</property>
<property>
<name></name>
<value type="String"></value>
</property>
.
.
<property>
<name></name>
<value type="Float"></value>
</property>
</properties>
<body>
<text>text message here</text>
<map>
<entry>
<name></name>
<value type="String"></value>
</entry>
<entry>
<name></name>
<value type="Integer"></value>
</entry>
.
.
<entry>
<name></name>
<value type="Float"></value>
</entry>
</map>
<bytes></bytes>
</body>
</jmsRequest>
Use this adapter request XML when you create a custom process by using the Call Adapter activity in TrueSight Orchestration Development Studio. The following figure shows an XML sample of the adapter request for the synchronous JMS actor adapter.
XML sample of the synchronous JMS actor adapter request
<dest>dynamicQueues/queue2.activemq.queue</dest>
<expiration>100</expiration>
<priority>8</priority>
<correlation-id>id-100</correlation-id>
<jms-type>Actor type</jms-type>
<request-response-wait-timeout>1000</request-response-wait-timeout>
<reply-to>dynamicQueues/queue1.activemq.queue</reply-to>
<properties>
<property>
<name>Emp ID</name>
<value type="Integer">31100</value>
</property>
<property>
<name>Emp NaMe</name>
<value type="String">Mr. Bean</value>
</property>
<property>
<name>Work hours</name>
<value type="Float">38.87</value>
</property>
</properties>
<body>
<bytes>First byte SGHGKJH87HCIU=</bytes>
<bytes>Second byte gagfsagf627356#$$</bytes>
</body>
</jmsRequest>
The following figure shows an XML sample of an asynchronous adapter request for the JMS actor adapter.
XML sample of the asynchronous JMS actor adapter request
<dest>dynamicQueues/queue2.activemq.queue</dest>
<reply-to>dynamicQueues/queue1.activemq.queue</reply-to>
<properties>
<property>
<name>fl Work</name>
<value type="Float">1000</value>
</property>
<property>
<name>do Work</name>
<value type="Double">1000</value>
</property>
<property>
<name>Emp ID</name>
<value type="Integer">31100</value>
</property>
<property>
<name>lo Work</name>
<value type="Long">92233</value>
</property>
<property>
<name>sh Work</name>
<value type="Short">922</value>
</property>
<property>
<name>Emp Name</name>
<value type="String">Mr. Bean </value>
</property>
<property>
<name>Transport</name>
<value type="Boolean">false</value>
</property>
<property>
<name>Transname</name>
<value type="Byte">12</value>
</property>
</properties>
<body>
<text>This is to test one</text>
<text>This is to test two</text>
<text>This is to test three</text>
</body>
</jmsRequest>
The following table describes the elements of the JMS actor adapter response to an asynchronous request.
Elements of the JMS actor adapter response to an asynchronous request
The following figure shows an XML template of an asynchronous adapter response for the JMS actor adapter.
XML template of the JMS actor adapter asynchronous response
<metadata>
<status></status>
<execution-milliseconds></execution-milliseconds>
</metadata>
<response-data>
<JMSMessageID></JMSMessageID>
</response-data>
</jms-response>
The following figure shows an XML sample of an asynchronous adapter response for the JMS actor adapter.
Asynchronous adapter response for the JMS actor adapter
<metadata>
<status>success</status>
<execution-milliseconds>195</execution-milliseconds>
</metadata> <response-data>
<JMSMessageID id="ID:localhost.localdomain-47999-1292232587198- 2:153:2:1:1" />
</response-data>
</jms-response>
The following table describes the elements of the JMS actor adapter response to a synchronous request.
Elements of the JMS actor adapter response to a synchronous request
The following figure shows an XML sample of a synchronous adapter response for the JMS actor adapter.
XML sample of the JMS synchronous actor adapter response
<metadata>
<status>success</status>
<execution-milliseconds>828</execution-milliseconds>
</metadata>
<response-data>
<message>
<destination>queue1.activemq.queue</destination>
<header>
<JMSDeliveryMode>2</JMSDeliveryMode>
<JMSExpiration>0</JMSExpiration>
<JMSPriority>4</JMSPriority>
<JMSMessageID>ID:realops-1081-1242887931765-0:14:2:1:1
</JMSMessageID>
<JMSTimestamp>1242968474890</JMSTimestamp>
<JMSCorrelationID>ID:realops-1081-1242887931765-0:14:1:1:1
</JMSCorrelationID>
<JMSType />
<JMSRedelivered>false</JMSRedelivered>
<JMSReplyTo>queue1.activemq.queue</JMSReplyTo>
</header>
<body>
<Bytes>SGHGKJH87HCIU=</Bytes>
</body>
</message>
<message>
<destination>queue1.activemq.queue</destination>
<header>
<JMSDeliveryMode>2</JMSDeliveryMode>
<JMSExpiration>0</JMSExpiration>
<JMSPriority>4</JMSPriority>
<JMSMessageID>ID:realops-1081-1242887931765-0:14:3:1:1
</JMSMessageID>
<JMSTimestamp>1242968475546</JMSTimestamp>
<JMSCorrelationID>ID:realops-1081-1242887931765-0:14:1:1:2
</JMSCorrelationID>
<JMSType />
<JMSRedelivered>false</JMSRedelivered>
<JMSReplyTo>queue1.activemq.queue</JMSReplyTo>
</header>
<body>
<Bytes>SGHGKJH87HCIU=</Bytes>
</body>
</message>
</response-data>
</jms-response>