Does JMS Virtual Service Support Message ID Based Correlation ?
Release : 10.5
Component : CA Service Virtualization
Answer: A Resounding YES
Perhaps the biggest strength of DevTest is the depth of Message queue based Virtualization. Time and again, this is proven to be true by working with various customers with various requirements.
First things first, What is Message ID based correlation ?
Its a mechanism to match a request that comes from a particular queue to a corresponding response from another queue. The backend service does the following:
With this kind of a mechanism, its very easy for a client to match a request with the correct response. Typically an asynchronous message selector is created on the response queue to listen to message that have the CorrelationID value same as that of the MessageID of request message object.
How to enable JMS Message ID Based Correlation for a Virtual Service ?
There are no specific pre-requisites for this. Just record and create your JMS Virtual Service Once the Virtual Service is created, just open the VSM file in Workstation and inspect the 'Respond' step. If you enable the 'Correlation scheme' and choose 'JMS Message ID to Correlation ID', then DevTest takes care of copying the value of JMS MessageID and set it to JMS Correlation ID of the response message. This was verified by playing around with this open and redeploying
few times. It works FLAWLESSLY.
5. How to verify if Message ID based Correlation Works in a Virtual Service?
First make sure you enable the Correlation Scheme as shown in the screenshot above
Deploy the virtual service
Send a request and receive a response in proxy request and response queues. Now, lets inspect the 'JMS Message ID' of Request Message an d 'JMS Correlation ID' of Response Message Checking Correlation ID of Response
This is straight forward. From the JMS Send receive test case, check the response object and inspect JMS Headers. You would be able to easily locate the Correlation ID value. Just note it. In this case it is
"414d5120716d31202020202020202020136bc95d20d5e802" We expect this value to be same as that of JMS Message ID of corresponding request message.
Lets check it.
Just note down the value of the property msg.messageid and it is "414d5120716d31202020202020202020136bc95d20d5e802" Comparing the 2 values side by side:
Request object JMS Message ID: 414d5120716d31202020202020202020136bc95d20d5e802
Response object JMS Correlation ID: 414d5120716d31202020202020202020136bc95d20d5e802