Ask a Question

Re: Set JMS header properties with Groovy

dilishtv
Occasional Contributor

Re: Set JMS header properties with Groovy

 

I'm using Ready API to post a JMS message using HermesJMS into our TIBCO EMS queue. I'm not using groovy to post the messages. I have one JMS custom property need to passed in as boolean. Currently the key value pair list supports only string.

I would like to do this using custom event handler. I saw Rao's post which has a "setMessageProperties" how can I get the "TextMessage" object from the context or the request object ?

 

Any help would be highly appreciated!

 

-Dilish

8 REPLIES 8
nmrao
Community Hero

Re: Set JMS header properties with Groovy

The above code snippet is applicable if you want to use in programming way.
You may directly set the headers to JMS request step, right?


Regards,
Rao.
dilishtv
Occasional Contributor

Re: Set JMS header properties with Groovy

Thanks for your reply Rao! That makes sense.

 

I'm currently setting it using the JMS header property but it is being passed as a string instead of boolean. Our TIBCO process is expecting a boolean value. 😞

 

I was looking for an option to override existing JMS Header before making the request using the event handler. 

 

 

nmrao
Community Hero

Re: Set JMS header properties with Groovy

Understand the point.

But have you tried sending boolean header with the JMS step? And you face any issue? If not, I would suggest you to try to set "true" as value for Boolean type header.


Regards,
Rao.
dilishtv
Occasional Contributor

Re: Set JMS header properties with Groovy

Yes. That's what I tried first and it was not working. I saw a feature request regarding JMS header data type on following thread

https://community.smartbear.com/t5/Ready-API-Feature-Requests/JMS-message-properties-should-support-...

 

Please see below header details from HermesJMS (toString tab)

 

JMS HeaderJMS Header 

 

Thanks,

Dilish

 

 

nmrao
Community Hero

Re: Set JMS header properties with Groovy

Are you sending a soap request over jms?


Regards,
Rao.
dilishtv
Occasional Contributor

Re: Set JMS header properties with Groovy

Yes

nmrao
Community Hero

Re: Set JMS header properties with Groovy

Ok, I saw your link that you pointed to an feature request. You may vote it if you like to SmartBear team address. They consider the features with more votes.

Mean while you can try tweaking submit before event and try to induce the other type of properties.

Can you please show the properties are being added to request, please?


Regards,
Rao.
dilishtv
Occasional Contributor

Re: Set JMS header properties with Groovy

I did upvote on that feature request. Actually, I 'm looking for help to tweak "submit before" event. Any code snippet will be helpful.

 

2016-11-11 10_24_10-Ready! API 1.9.0 - SoapUI NG.png

 

cancel
Showing results for 
Search instead for 
Did you mean: