Bug 55589 - JMS Publisher/Point to Point : Add ability to set typed values in JMS header properties.
Summary: JMS Publisher/Point to Point : Add ability to set typed values in JMS header ...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.9
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-24 13:28 UTC by nicolas.mercier
Modified: 2016-05-18 17:15 UTC (History)
2 users (show)



Attachments
Patch to implement feature (44.33 KB, patch)
2013-11-24 21:38 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nicolas.mercier 2013-09-24 13:28:03 UTC
Hello,

Is it possible to have the possibility to set the JMS header properties with numeric values?

Thanks.
Comment 1 Sebb 2013-09-24 14:50:13 UTC
Bugzilla is not a support forum.

Please subscribe to the JMeter user list and ask there.
Comment 2 Philippe Mouawad 2013-09-24 15:32:41 UTC
Hello sebb,
I think this is an enhancement request as today you can only pass String properties on JMS Messages:
- msg.setStringProperty(name, value);

Enhancement would be:
JMS Publisher/Point to Point : Add ability to set typed values in JMS header properties.
Comment 3 Philippe Mouawad 2013-09-25 19:43:50 UTC
According to this:

http://docs.oracle.com/javaee/6/api/javax/jms/Message.html

Message properties support the following conversion table. The marked cases must be supported. The unmarked cases must throw a JMSException. The String-to-primitive conversions may throw a runtime exception if the primitive's valueOf method does not accept the String as a valid representation of the primitive.

A value written as the row type can be read as the column type.

 |        | boolean byte short int long float double String 
 |----------------------------------------------------------
 |boolean |    X                                       X
 |byte    |          X     X    X   X                  X 
 |short   |                X    X   X                  X 
 |int     |                     X   X                  X 
 |long    |                         X                  X 
 |float   |                               X     X      X 
 |double  |                                     X      X 
 |String  |    X     X     X    X   X     X     X      X 
 |----------------------------------------------------------
 


So currently provided value is convertible to primitive type, writing in String as JMeter does would work fine.

But this feature is still interesting to implement.
Comment 4 Philippe Mouawad 2013-10-02 15:58:42 UTC
The JMS spec states that a String property should not get converted to a numeric when used in a selector. 
This means this feature is in fact very useful and should be implemented.
It is even useful in the case the JMS provider is old and would not support those conversions.
Comment 5 Josh Garlick 2013-11-05 19:55:20 UTC
Any updates on this? Can anyone provide a proposed patch?
Comment 6 Philippe Mouawad 2013-11-24 21:38:31 UTC
Created attachment 31074 [details]
Patch to implement feature
Comment 7 Philippe Mouawad 2013-11-24 22:26:44 UTC
Date: Sun Nov 24 22:21:58 2013
New Revision: 1545089

URL: http://svn.apache.org/r1545089
Log:
Bug 55589 - JMS Publisher/Point to Point : Add ability to set typed values in JMS header properties.
Bugzilla Id: 55589

Added:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java   (with props)
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSProperties.java   (with props)
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSProperty.java   (with props)
Modified:
    jmeter/trunk/bin/saveservice.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/Publisher.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/PublisherSampler.java
    jmeter/trunk/xdocs/changes.xml
    
Date: Sun Nov 24 22:22:55 2013
New Revision: 1545091

URL: http://svn.apache.org/r1545091
Log:
Bug 55589 - JMS Publisher/Point to Point : Add ability to set typed values in JMS header properties.
Bugzilla Id: 55589

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
    
Date: Sun Nov 24 22:23:55 2013
New Revision: 1545092

URL: http://svn.apache.org/r1545092
Log:
Bug 55589 - JMS Publisher/Point to Point : Add ability to set typed values in JMS header properties.
Bugzilla Id: 55589

Modified:
    jmeter/trunk/bin/saveservice.properties
    
Date: Sun Nov 24 22:24:30 2013
New Revision: 1545094

URL: http://svn.apache.org/r1545094
Log:
Bug 55589 - JMS Publisher/Point to Point : Add ability to set typed values in JMS header properties.
Bugzilla Id: 55589

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
    
Date: Sun Nov 24 22:25:42 2013
New Revision: 1545095

URL: http://svn.apache.org/r1545095
Log:
Bug 55589 - JMS Publisher/Point to Point : Add ability to set typed values in JMS header properties.
set svn:eol Native
Bugzilla Id: 55589

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java   (props changed)
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSProperties.java   (props changed)
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSProperty.java   (props changed)
Comment 8 Philippe Mouawad 2013-11-26 08:14:37 UTC
(In reply to Josh Garlick from comment #5)
> Any updates on this? Can anyone provide a proposed patch?

This is implemented now and available in nightly build, your feedback is welcome:
http://ci.apache.org/projects/jmeter/nightlies/
Comment 9 The ASF infrastructure team 2022-09-24 20:37:55 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3240