vijaydi
8 years agoContributor
JMS Mock - Extract Header Value from Incoming request and set in the JMS dispatch response property.
Hi,
I have a mock implementation of JMS message. I am trying to capture custom header value from the incoming request into the mock and set that value in the response header of the mock response before dispatching it.
Tried the below line of code. Works well for HTTP mock requests but not for JMS messages coming into the mock.
def Host= mockRequest.getRequest().getHeader("Host").toString() log.info(Host)
Would really appreciate if you someone could shed some light on it.
Thanks
Since that is a jms message, you can give a try below:
//If works, then it should fetch the value of SubscriberId property
log.info mockRequest.message.getStringProperty('SubscriberId')