Bug 51419 - JMS Subscriber: ability to use Selectors
Summary: JMS Subscriber: ability to use Selectors
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.4
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 18:17 UTC by Yaroslav
Modified: 2012-01-15 13:42 UTC (History)
1 user (show)



Attachments
Demo Test Plan (8.38 KB, application/xml)
2011-10-17 17:45 UTC, Philippe Mouawad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yaroslav 2011-06-22 18:17:13 UTC
The current implementation does not support to get a JMS message from a queue by its property.

It could be implemented by adding simple "Selectors" item right after "Destination" item.

In this case User could add "JMSType = `car' AND color = `blue' AND weight > 2500" for instance.

Below are some requirements from JMS standards:

A JMS message selector allows a client to specify by message header the messages it's interested in. Only messages whose headers match the selector are delivered. The semantics of not delivered differ a bit depending on the MessageConsumer being used (see QueueReceiver and TopicSubscriber). 

Message selectors cannot reference message body values. 

A message selector matches a message when the selector evaluates to true when the message's header field and property values are substituted for their corresponding identifiers in the selector. 

A message selector is a String, whose syntax is based on a subset of the SQL92 conditional expression syntax.
Comment 1 Yaroslav 2011-06-22 18:36:36 UTC
It User's responsibility to provide correct and valid string for that.
Comment 2 Philippe Mouawad 2011-10-15 14:43:28 UTC
Date: Sat Oct 15 14:42:43 2011
New Revision: 1183653

URL: http://svn.apache.org/viewvc?rev=1183653&view=rev
Log:
Bug 51419 - JMS Subscriber: ability to use Selectors

Modified:
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
   jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ReceiveSubscriber.java
   jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java
   jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
   jakarta/jmeter/trunk/xdocs/changes.xml
   jakarta/jmeter/trunk/xdocs/images/screenshots/jms/jms_pub.png
   jakarta/jmeter/trunk/xdocs/images/screenshots/jms/jms_sub.png
   jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 3 Yaroslav 2011-10-17 16:54:38 UTC
Is it possible to have any "help" how to use it with current implementation?
Comment 4 Philippe Mouawad 2011-10-17 17:45:36 UTC
Created attachment 27798 [details]
Demo Test Plan

Hello, 
Here is a test plan that works with nightly build integrating this feature.

Notice that message has property called type = ORDER
and selector is set to type='ORDER' meaning subscriber will only extract messages posted with this property.

Comment on what you exactly need.
Regards
Philippe
Comment 5 Yaroslav 2011-10-18 19:22:04 UTC
Verified r1183653

The implementation looks perfect.

Just one note - would be nice to specify in Help what is max length for "JMS Selector" field.
Comment 6 Philippe Mouawad 2012-01-15 13:42:00 UTC
Thanks for verification.
Marking issue as RESOLVED to avoid it appearing in Bug Report.
Comment 7 The ASF infrastructure team 2022-09-24 20:37:46 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2504