Set JMSType header field through JMSProperties. #600
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Allow the JMSType header field to be set using the JMSProperties.
Motivation and Context
JMeter seems to assume that all JMS implementations support setting the JMSType header field of a Message through the JMSProperties. This is not necessarily the case. The proprietary JMS implementation I use at our company does not support this and requires the JMSType header field to be set using Message.setJMSType. The JMS spec does not seem to require implementations to set the header fields through the message properties. It does state that JMSCorrelationId, JMSType and JMSReplyTo should be set by the client.
Since there already is a similar fix in place for WebSphereMQ where the JMSCorrelationId is set explicitly when a property with that name is set, it seemed only logical to do the same for JMSType.
How Has This Been Tested?
Ran all unit tests, no test failures so this change does not seem to affect existing code.
Using our proprietary JMS implementation, added message property "JMSType" to a message. Send message, check request headers.
Prior to change: JMSType header field remained empty. A property with the name "JMSType" appeared under "Properties" containing the value.
After change: JMSType header field is set to expected value. No separate property, see screenshot.
Screenshots (if appropriate):
When setting JMSType through properties, the JMSType would end up empty in the request header and a separate "JMSType" property would end up under "Properties:". After this change, the result looks as expected.
Types of changes
Checklist:
note: since there does not seem to be any documentation for the existing CorrelationId fix, I have not added any documentation for this change.