JMSRequestor4.0
The JMSRequestor component is used to send messages to a JMS Topic/Queue and wait till a message reply is received from the same. After sending the message to the Destination set in the CPS, JMSRequestor waits for the response message on the Response Destination. If Response Destination is not specified in the CPS, then a temporary destination is created on which the response message is expected. Users can also specify an Error Destination on which JMSRequestor receives the error message.
JMSRequestor is capable of handling following types of messages:
- Text messages
A TextMessage object's message body contains a java.lang.String object. - Map messages
A MapMessage object's message body contains a set of name-value pairs, where names are String objects, and values are Java primitives. The entries can be accessed sequentially or randomly by name. The order of the entries is undefined. Bytes Message
A BytesMessage object's message body contains a stream of uninterrupted bytes. This message type is for literally encoding a body to match an existing message format.JMSRequestor uses JMS APIs to process the messages.
Points to note
- The only restriction on Map Messages is that this component does not support Objects in Map Messages.
- When adding the Initial Context Factory class for non Fiorano MQ server, the jar file(s) should be added as resource(s) to the JMSAdapters system library.
- JMSRequestor will not process further messages it receives on its input port till it receives the response for the current message.
- If IsDurableSubscriber property is changed to No or Destination Type is changed from Topic to Queue or ClientID/Subscriber ID is changed - the durable subscriptions created earlier should be unsubscribed to avoid persisting messages for the durable subscriber in runtimedata. For more information on unsubscribing, please refer to the DurableSubscribers view section in Chapter 32.3: Connecting to Web Management Tool of FioranoMQ Handbook.
Configuration and Testing
Managed Connection Factory
Figure 1: Managed Connection Factory panel
Please refer the respective sections in JMSIn4.0 page as properties in the Managed Connection Factory panel are the same for both the components.
Interaction Configurations
Figure 2: Interaction Configurations panel
Output Destination Settings
Message Type Configuration
Figure 3: Message Type Configuration panel
Please refer the section in JMSIn4.0 page.
Destination Configuration
Figure 4: Destination Configuration panel
Destination Name
Name of the Topic/Queue to be subscribed to.
For BEA Weblogic, value for Destination Name should be the JNDI name of the destination.
Producer Configuration
Please refer the section in JMSIn4.0 page.
Output Message Configuration
Please refer Mesaage Type Configuration section in this page.
Consumer Configuration
Please refer the section in JMSOut4.0 page.
Retain Application Context
Specifies whether the application context has to be retained
Monitoring Configuration
Please refer Monitoring Configuration section in Common Configurations page.
Expert Properties
These attributes are meant for advanced users.
Figure 4: Destination Configuration panel with the Expert Properties view highlighted
Response Destination
Destination on which response is expected. This is an optional configuration; if this is not specified, a temporary destination will be created.
CorrelationId Prefix
Prefix used for setting Correlation ID.
Response Destination Type
Specifies the response destination; choose from the below options:
- Topic
- Queue
Error Destination
Destination on which error is expected. This is an optional configuration; if this is not specified, errors are expected on Response Destination.
Error Destination Type
Specifies the destination type for the Error Destination option chosen; choose from the below options:
- Topic
- Queue
For descriptions of Expert properties given below, please refer the Interaction Configurations section in Common Configurations page:
- Pre Processing XSL Configuration
- Post Processing XSL Configuration
- Process Message Based On a Property
- Validate Input
- Cleanup Resources (excluding connection) after each document
- Target Namespace
- Elements to Decrypt
- Elements to encrypt
Action when message is not available?
Please refer the section in JMSOut4.0 page.
Execution Timeout
Maximum time in milliseconds the component should wait for a message. The default value is "0" which specifies infinite wait time, that is, waits until a message is received.
Scheduler Configuration
Please refer Scheduler Configurations section in Common Configurations page.
Error Handling
Please refer Error Handling section in Common Configurations page.
Functional Demonstration
Scenario 1
Sending a request from JMSRequestor4.0 to the JMSReplier in plain text format; if successful, the plain text message gets processed as output from JMSReplier back to JMSRequestor.
Mappings, if required, are to be done in the Mapper Perspective project of the Replier.
Configure both the components as described in the Configuration and Testing section above and use Feeder and Display components to send sample input and check the response respectively.
Figure 5: Event Process demonstrating JMSRequestor and JMSReplier functionalities
Sample Input
Below is the sample generated using the Feeder.
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Message xmlns:ns1="http://www.fiorano.com/fesb/activity/JMSRequestor1/ReqestReply/In">
<ns1:JMSHeader>
<ns1:JMSCorrelationID>ID1</ns1:JMSCorrelationID>
<ns1:JMSDestination>Destination1</ns1:JMSDestination>
</ns1:JMSHeader>
<ns1:Properties>
<ns1:Property name="name" type="double">123</ns1:Property>
</ns1:Properties>
<ns1:Body>Body</ns1:Body>
</ns1:Message>
Output
After running the Event Process, output will be displayed in the Display component if the message is successfully sent.
Figure 6: Output as seen in the Display component window
Output copied from Display component
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Message xmlns:ns1="http://www.fiorano.com/fesb/activity/JMSRequestor1/Requestor/Out">
<ns1:JMSHeader>
<ns1:JMSCorrelationID>ID1</ns1:JMSCorrelationID>
<ns1:JMSDeliveryMode>2</ns1:JMSDeliveryMode>
<ns1:JMSDestination>JMSX_TEMP_TOPIC_-92233720368547757851440060319249</ns1:JMSDestination>
<ns1:JMSExpiration>0</ns1:JMSExpiration>
<ns1:JMSMessageID>ID:289_f_1440060297543_f_15</ns1:JMSMessageID>
<ns1:JMSPriorityTag>4</ns1:JMSPriorityTag>
<ns1:JMSRedelivered>false</ns1:JMSRedelivered>
<ns1:JMSReplyTo>JMSX_TEMP_TOPIC_-92233720368547757851440060319249</ns1:JMSReplyTo>
<ns1:JMSTimeStamp>1440060446235</ns1:JMSTimeStamp>
<ns1:JMSTypeTag>TextMessage</ns1:JMSTypeTag>
</ns1:JMSHeader>
<ns1:Properties>
<ns1:Property name="JMSXDeliveryCount" type="int">1</ns1:Property>
<ns1:Property name="name" type="double">123.0</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__IN_TIME" type="long">1440060446219</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__EVENT_PROCESS_ENVIRONMENT" type="String">development</ns1:Property>
<ns1:Property name="COMPONENT_IN_TIME" type="String">1440060446214</ns1:Property>
<ns1:Property name="COMPONENT_PROCESSING_TIME" type="String">4</ns1:Property>
<ns1:Property name="RequestorID" type="String">RequestorID__f_jms5_1440060319147__f__-9223372036854775807</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__OUT_TIME" type="long">1440060446224</ns1:Property>
<ns1:Property name="IsErrorResponse" type="boolean">false</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__EVENT_PROCESS_NAME" type="String">EVENT_PROCESS11</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__ROUTE_NAME" type="String">EVENT_PROCESS11__1_0__JMSReplier1__route1</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__INPUT_PORT" type="String">IN_PORT</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__COMP_INST_NAME" type="String">JMSReplier1</ns1:Property>
<ns1:Property name="ESBX__SYSTEM__EVENT_PROCESS_VERSION" type="String">1.0</ns1:Property>
</ns1:Properties>
<ns1:Body>Body</ns1:Body>
</ns1:Message>
Scenario 2
Sending a request from JMSRequestor4.0 to the JMSReplier in 'Byte Message as Base 64 encoded Text' format; if successful, the byte message gets processed as output from JMSReplier back to JMSRequestor.
Mappings, if required, are to be done in the Mapper Perspective project of the Replier on route1. Here, Body is encoded using Base64-Encode-from-String on route2 and decoded using Base64-Decode-to-String on route3.
Configure both the components as described in the Configuration and Testing section above and use Feeder and Display components to send sample input and check the response respectively.
Figure 7: Event Process demonstrating JMSRequestor and JMSReplier functionalities
Sample Input
Below is the sample generated using the Feeder.
<ns1:Message xmlns:ns1="http://www.fiorano.com/fesb/activity/JMSRequestor1/ReqestReply/In">
<ns1:Body>Body</ns1:Body>
</ns1:Message>
Output
After running the Event Process, output will be displayed in the Display component if the message is successfully sent.
Figure 8: Output as seen in the Display component window
Output copied from Display component
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Message xmlns:ns1="http://www.fiorano.com/fesb/activity/JMSRequestor1/Requestor/Out" xmlns:ns2="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns1:JMSHeader>
<ns1:JMSCorrelationID>Correlation__f_jms5_1554899034398__f__-9223372036854775806</ns1:JMSCorrelationID>
<ns1:JMSDeliveryMode>2</ns1:JMSDeliveryMode>
<ns1:JMSDestination>JMSX_TEMP_TOPIC_-92233720368547757991554899034499</ns1:JMSDestination>
<ns1:JMSExpiration>0</ns1:JMSExpiration>
<ns1:JMSMessageID>ID:568_f_1554898998538_f_5</ns1:JMSMessageID>
<ns1:JMSPriorityTag>4</ns1:JMSPriorityTag>
<ns1:JMSRedelivered>false</ns1:JMSRedelivered>
<ns1:JMSReplyTo>JMSX_TEMP_TOPIC_-92233720368547757991554899034499</ns1:JMSReplyTo>
<ns1:JMSTimeStamp>1554899034834</ns1:JMSTimeStamp>
<ns1:JMSTypeTag>BytesMessage</ns1:JMSTypeTag>
</ns1:JMSHeader>
<ns1:Properties>
<ns1:Property name="JMSXDeliveryCount" type="int">1</ns1:Property>
</ns1:Properties>
<ns1:Body>Body</ns1:Body>
</ns1:Message>