Mapping a response to
a request in a request-reply interaction requires correlation.The MQ adapter
provide the inbuilt options to correlate the request and response messages,
there is no need of implementing the custom correlation to correlate the request
and response messages.
Each MQSeries request
message contains a message ID and a correlation ID. When an application
receives a request message from Oracle BPEL PM, it checks for the correlation
schema defined for the response message. Based on the correlation schema, the
application generates the message ID and correlation ID of the response
message. Based on the Message ID/Correlation ID the request/response messages
will be correlated in the MQAdapter.
The below are the two
patterns to correlate the request/response messages in MQ adapter.
·
Get Message from MQ
and Send Reply
·
Send Message to MQ and
Get Reply
Get Message from MQ
and Send Reply:
MQ adapter gets a
message from the inbound Queue and send a reply message to the outbound bound
queue Synchronously/Asynchronously.
·
Create a composite
with synchronous/asynchronous BPEL process.
·
Delete the default
service created and add the MQ Adapter service
·
Add the MQ JNDI name
in the 3rd step of MQ adapter
definition.
·
Select the
operation as Get message to MQ and Get Reply/Reports and the option name as
Asynchronous/Synchronous in the 5th step.
· Select the Message Type as Normal and enter the request queue name as
part 6th step.
·
Enter the reply queue
in the 7th step
·
Configure the
input/output schema s in 8th step
·
Delete the default
parnerlink in the BPEL and connect to the partner link created for the MQ.
·
Delete and Recreate
the input/output variables and complete the BPEL design as per the requirement.
·
Double click on the
receiveInput activity in the BPEL and select the properties tab.
·
Select the messageid
as the input for the property jca.mq.MQMD.MsgId – Create the messageid variable
before as string type.
·
Open the
callbackclient activity and select the properties tab, add the messageid
variable as the input to the property jca.mq.MQMD.MsgId
·
Deploy the code and
test.
Send Message to
MQ and Get Reply:
·
Design the Composite
and the BPEL process.
·
Configure the MQ
adapter as a reference by following the steps mentioned above.
·
Make sure the Message
Type selected as Normal in the 6th step
·
Make sure the
Message ID and the Correlation ID values selected as shown below in the 7th step.
·
Deploy the composite
and test.
No comments:
Post a Comment