How to add custom headers to the Rabbit MQ VSI response

Document ID : KB000105816
Last Modified Date : 09/07/2018
Show Technical Document Details
Question:
A Rabbit MQ virtual service was created from RR Pairs. We now need to add some additional headers to the response.
How to add custom headers to the Rabbit MQ VSI response?
Answer:
Since the virtual service was created from request and response pairs (RR Pairs), the Recorder did not have all the header information to populate the response meta-data.
When this is the case, we could try two things:
1. do a live recording and capture the transactions with the headers we are looking for.
Then we can see how the headers are coming in the VSI.
We can copy these headers and update the previous VSI response created from RR Pairs.

2. Start the VSE Recorder and create a new VSI sending the request with the proper headers.
If we can send the request from a client application with the correct headers that will be better.
If not, then we can send a request from DevTest Rabbit MQ step and add the headers in the request side of the test step.
RabbitMQCustomHeaders
 
More details in the link below:
https://docops.ca.com/devtest-solutions/10-3/en/reference/test-step-descriptions/rabbitmq-steps/rabbitmq-send-receive-step/#RabbitMQSendReceiveStep-MessageProperties

Send the request to the queue the VSE Recorder is listening and create a new VSI.
The headers will be available in the VSI request meta-data, but we can copy the headers key from the request and paste them in the response meta-data.
The names for the headers will be the same for request and response, the value will change as required.
Additional Information:
You can find more information regarding Rabbit MQ Assets in the links below:
https://comm.support.ca.com/kb/how-to-create-rabbit-mq-assets/KB000102437
https://docops.ca.com/devtest-solutions/10-3/en/reference/asset-descriptions/rabbitmq-assets
https://docops.ca.com/devtest-solutions/10-3/en/using/using-ca-service-virtualization/using-devtest-workstation-with-ca-service-virtualization/creating-service-images/create-a-service-image-by-recording/transport-protocols/rabbitmq-transport-protocol/