You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Tom_Z <to...@arcor.de> on 2014/05/07 18:20:59 UTC

Testing against ActiveMQ with JMeter: how to set JMSPriority and JMSExpiration, values cannot be seen in Broker

Hi,  

I try to run priority focussed tests with JMeter 2.11 against ActiveMQ 5.8
and some queues defined in the broker xml config. 

I successfully managed to push messages into the queues by the
JMeter-Samplers "JMS-Point-Point" and also "JMS-Publisher".

With both samplers I do set JMS properties whereas these are accepted by the
broker and logged into the logfile when a message is received:
- JMSType (e.g. text, binary) 
- JMSXGroupID
- JMSXGroupSeq
- JMSCorrelationID

But the properties "JMSPriority" and "JMSExpiration" are ignored and never
set at the message. I tried both samplers, different property data types,
..., but the values are always the defaults 4 respectively 0. 



I configured the queues to support message priority
(http://activemq.apache.org/how-can-i-support-priority-queues.html) and I do
understand that delivery to a client always in order of priority depends on
different other settings
(http://architects.dzone.com/articles/activemq-message-priorities), but the
value provided by the producer should nevertheless be accepted and logged? 

Since JMSExpiration doesn't work too I guess it's a matter of providing
those values from JMeter via the ActiveMQ-Client-Impl to the broker? Is it
possible at all to set those message properties with JMeter and to test
scenarios of message priority?

Thanks,
Tom 



--
View this message in context: http://activemq.2283324.n4.nabble.com/Testing-against-ActiveMQ-with-JMeter-how-to-set-JMSPriority-and-JMSExpiration-values-cannot-be-seen-r-tp4680960.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Testing against ActiveMQ with JMeter: how to set JMSPriority and JMSExpiration, values cannot be seen in Broker

Posted by Tom_Z <to...@arcor.de>.
Filed an issue and provided a patch:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56510



--
View this message in context: http://activemq.2283324.n4.nabble.com/Testing-against-ActiveMQ-with-JMeter-how-to-set-JMSPriority-and-JMSExpiration-values-cannot-be-seen-r-tp4680960p4681048.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Testing against ActiveMQ with JMeter: how to set JMSPriority and JMSExpiration, values cannot be seen in Broker

Posted by Tom_Z <to...@arcor.de>.
Yes or to be correct at the message, e.g. CorrelationID:

org.apache.jmeter.protocol.jms.Utils.addJMSProperties(Message, Map<String,
Object>):


The same should apply to properties "JMSPriority" (msg.setJMSPriority(int))
and "JMSExpiration" (msg.setJMSExpiration(long)).

I will file a feature issue and try to provide a patch in the next couple of
days.

Tom



--
View this message in context: http://activemq.2283324.n4.nabble.com/Testing-against-ActiveMQ-with-JMeter-how-to-set-JMSPriority-and-JMSExpiration-values-cannot-be-seen-r-tp4680960p4681004.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Testing against ActiveMQ with JMeter: how to set JMSPriority and JMSExpiration, values cannot be seen in Broker

Posted by artnaseef <ar...@artnaseef.com>.
Is there a way in jmeter to set properties on the JMS producer?  That might
work.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Testing-against-ActiveMQ-with-JMeter-how-to-set-JMSPriority-and-JMSExpiration-values-cannot-be-seen-r-tp4680960p4681003.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Testing against ActiveMQ with JMeter: how to set JMSPriority and JMSExpiration, values cannot be seen in Broker

Posted by Tom_Z <to...@arcor.de>.
I took a look at the jmeter source code, there are some other settings and
properties treated in a special way, e.g.:

1. Checkbox for persistent delivery --> set at the MessageProducer in
org.apache.jmeter.protocol.jms.client.Publisher

2. JMSCorrelationID taken from JMS-Properties list --> set at the message in
org.apache.jmeter.protocol.jms.Utils

It seems that those other properties are not yet supported.

Tom



--
View this message in context: http://activemq.2283324.n4.nabble.com/Testing-against-ActiveMQ-with-JMeter-how-to-set-JMSPriority-and-JMSExpiration-values-cannot-be-seen-r-tp4680960p4680996.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Testing against ActiveMQ with JMeter: how to set JMSPriority and JMSExpiration, values cannot be seen in Broker

Posted by artnaseef <ar...@artnaseef.com>.
As per the JMS specification, several headers, including JMSPriority, are set
on send() by the JMS provider (ActiveMQ).  This means that values specified
by clients are overwritten.

Here's the spec; see section 3.4.11, "How Message Header Values are Set":

http://download.oracle.com/otn-pub/jcp/7195-jms-1.1-fr-spec-oth-JSpec/jms-1_1-fr-spec.pdf?AuthParam=1399518519_977545569f47e0da60da93ab6d7b22f0

To set the priority, the producer's setPriority() or "send(Destination
destination, Message message, int deliveryMode, int priority, long
timeToLive)" needs to be used.  I'm not sure how that can be accomplished
with JMeter.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Testing-against-ActiveMQ-with-JMeter-how-to-set-JMSPriority-and-JMSExpiration-values-cannot-be-seen-r-tp4680960p4680975.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.