- synchronous request reply interaction pattern
- asynchronous request reply interaction pattern
Synchronous request reply interaction pattern
This pattern allows the Oracle JMS Adapter sends a request to the request JMS queue and waits for a response from the reply JMS queue before further execution continues.In turn, the adapter will set the JMSReplyTo header to the reply destination. This value is then used by a message consumer to send the message to the reply destination which is then dequeued by the Oracle JMS Adapter and continue further processing.
JMS adapter wizard showing Request/Reply operation modelling
Above wizard generates below JCA file
<adapter-config name="SyncRequest-Reply" adapter="JMS Adapter" wsdlLocation="SyncRequest_Reply.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
<connection-factory location="eis/wls/Queue" UIJmsProvider="WLSJMS" UiOperationMode="Synchronous" UIConnectionName="Dev2"/>
<endpoint-interaction portType="Request_Reply_ptt" operation="Request_Reply" UITransmissionPrimitive="Request-response">
<interaction-spec className="oracle.tip.adapter.jms.outbound.JmsRequestReplyInteractionSpec">
<property name="TimeToLive" value="0"/>
<property name="PayloadType" value="TextMessage"/>
<property name="DeliveryMode" value="Persistent"/>
<property name="ReplyDestinationName" value="jms/b2b/B2B_IN_QUEUE"/>
<property name="RequestDestinationName" value="jms/b2b/B2B_OUT_QUEUE"/>
</interaction-spec>
</endpoint-interaction>
</adapter-config>
Oracle recommendations for this pattern
- Oracle suggests when using the Oracle JMS Adapter in a synchronous pattern ensure that you use a non-XA connection factory and set the connector factory isTransacted property to true in weblogic-ra.xml.
- The connection factory must be weblogic.jms.ConnectionFactory or any other non-XA connection factory.
Asynchronous request reply interaction pattern
We can use the Adapter configuration wizard to model a process that allows Oracle JMS Adapter to be used in an asynchronous request reply interaction pattern.
This pattern allows an Oracle JMS Adapter to send a message to a JMS destination.
When sending message it sets JMSReplyTo header on request message to Reply destination JNDI name
Consumer reads the header on message and replies to that destination.
When a message is received on the reply queue, the Oracle JMS Adapter is able to route message to the correct composite or the component instance. The correlation is done based on the JMSMessageID of the request message, which becomes the JMSCorrelationID of the reply message, and the conversation ID of the underlying component.
JMS adapter wizard showing Async Request/Reply operation modelling
Above wizard generates below JCA file.Note that there are two interaction specs generated. One for producing and another for consuming message
<connection-factory location="eis/wls/Queue" UIJmsProvider="WLSJMS" UiOperationMode="Asynchronous" UIConnectionName="Dev2"/>
<endpoint-activation portType="Reply_ptt" operation="Reply" UITransmissionPrimitive="Request-response">
<activation-spec className="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec">
<property name="PayloadType" value="TextMessage"/>
<property name="UseMessageListener" value="false"/>
<property name="DestinationName" value="jms/b2b/B2B_OUT_QUEUE"/>
</activation-spec>
</endpoint-activation>
<endpoint-interaction portType="Request_ptt" operation="Request" UITransmissionPrimitive="Request-response">
<interaction-spec className="oracle.tip.adapter.jms.outbound.JmsProduceInteractionSpec">
<property name="TimeToLive" value="0"/>
<property name="PayloadType" value="TextMessage"/>
<property name="DeliveryMode" value="Persistent"/>
<property name="DestinationName" value="jms/b2b/B2B_IN_QUEUE"/>
</interaction-spec>
</endpoint-interaction>
If we get into BPEL design we will be having invoke activity pointing to JMS adapter reference invoking Request operation and we need to use receive activity pointing to same JMS adapter reference but waiting on Receive operation