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

Element

Description

Required

<dest>

Specifies the lookup name for the destination queue or topic
This element does not support a temporary destination (dynamic queue or topic).

Yes

<body>

Contains the messages (of at least one type) to be sent

Yes

<properties>

Contains the <property> elements
It must contain at least one <property> element.

No

<reply-to>

Specifies the JMSDestination name (queue or topic) to which to send a reply

No

<expiration>

Specifies the JMSExpiration header property that specifies when a message will expire
The time is specified in milliseconds.

No

<priority>

Specifies the JMSPriority header property that defines the transmission priority levels for a message from 0 (lowest) to 9 (highest).

No

<correlation-id>

Specifies the JMSCorrelationID header property to link two messages together (for example, to link a reply to a request)

No

<jms-type>

Specifies the JMSType header property that identifies the message type, which is set by the client computer

No

<delivery-mode>

Specifies the JMSDeliveryMode header property that defines the persistence of a message
Valid values: PERSISTENT, NON_PERSISTENT

No

<property>

Contains the <name> and <value> tags for each property specified for a message

Each <property> tag can contain only one type of value.

Conditional

<text>

Specifies the text of a message in text or XML format

Conditional

<map>

Contains the map message data in <entry> elements, each of which contains a <name> and a <value> element

The value of the <name> element must be unique.

Conditional

<bytes>

Contains a stream of uninterrupted bytes

Conditional

<request-response-wait-timeout>

Specifies the time (in milliseconds) for which the actor adapter waits for a reply to the message

If this element is present in the request with a valid value, the adapter sends the message synchronously. If the reply is received before the timeout ends, the adapter sends the next message. Otherwise, the adapter waits for the timeout to end and then sends the next message.

No

<character-set>

Specifies the character set used to encode or decode the characters

This parameter is required if you use a dynamic target.
For example, Shift_JIS supports the Japanese character set and Big5 supports the traditional Chinese character set.

Default value: ISO-8859-2

No


The following figure shows an XML template for the JMS actor adapter request.

XML template of the JMS actor adapter request

<jmsRequest>
    <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 BMC Atrium Orchestrator 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

<jmsRequest> 
<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

<jmsRequest> 
<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

Element

Description

<metadata>

Contains the <status> and <execution-milliseconds> elements

<status>

Indicates the status of a command execution
Valid values: success, error

<execution-milliseconds>

Specifies the time (in milliseconds) taken to execute a command

<error>

Indicates the error message returned when the value of the <status> element is error
When the value of the <status> element is success, this element is absent.

<response-data>

Contains the <JMSMessageID> and the <error> elements

<JMSMessageID>

Contains the message IDs for all the messages defined in the request
The order of these elements is the same as the order of the corresponding messages in the adapter request.

<error>

Specifies the error, if any, when sending a message


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

<jms-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

<jms-response> 
 <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

Element

Description

<metadata>

Contains the <status> and <execution-milliseconds> elements

<status>

Indicates the status of command execution

Valid values: success, error

<execution-milliseconds>

Specifies the time (in milliseconds) taken to execute a command

<error>

Indicates the error message when the value of the <status> element is error

When the value of the <status> element is success, this element is absent.

<response-data>

Contains the <JMSMessageID> and the <error> elements

<message>

Contains information about the received response The order of these elements is the same as the order of the corresponding messages in the adapter request.

<error>

Specifies the error, if any, when sending a message and occurs in the <response-data> element

<no-response>

Occurs in the <message> element if a response is not received in the interval specified in the <request-response-wait-timeout> element


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

<jms-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>
Was this page helpful? Yes No Submitting... Thank you

Comments