You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jim_Cross <ji...@googlemail.com> on 2007/06/05 11:09:31 UTC

Message Selector Not Filtering Messages

Hi,

I'm using ActiveMQ with a Java producer and a C# (NMS) consumer.
Everything seems to be working, except my message selectors, which don't
filter out any messages.
For example, if I use the following in my producer:

TextMessage testMessage = session.createTextMessage();
testMessage.setStringProperty("URI",
"http://localhost/slide/files/data/test/text.txt");
testMessage.setStringProperty("SubPath", "data/test");
testMessage.setText(content);
producer.send(testMessage);

And this in the consumer:

IMessageConsumer consumer = session.CreateConsumer(dest, "SubPath = 'x'");

I would not expect any messages to flow through, as they should be filtered
by SubPath. However, my consumer receives all of the messages.
Can anyone tell me what I'm doing wrong, or whether there's a way I can turn
up the logging to see why the selector isn't filtering out these messages?

As an aside, am I right in thinking you can't create non-temporary topics
using NMS?

Thanks,

Jim

-- 
View this message in context: http://www.nabble.com/Message-Selector-Not-Filtering-Messages-tf3870553s2354.html#a10965883
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Message Selector Not Filtering Messages

Posted by Jim_Cross <ji...@googlemail.com>.
Hmm, I just tried this with an integer property as well, and still the
messages aren't filtered...


Jim_Cross wrote:
> 
> Hi,
> 
> I'm using ActiveMQ with a Java producer and a C# (NMS) consumer.
> Everything seems to be working, except my message selectors, which don't
> filter out any messages.
> For example, if I use the following in my producer:
> 
> TextMessage testMessage = session.createTextMessage();
> testMessage.setStringProperty("URI",
> "http://localhost/slide/files/data/test/text.txt");
> testMessage.setStringProperty("SubPath", "data/test");
> testMessage.setText(content);
> producer.send(testMessage);
> 
> And this in the consumer:
> 
> IMessageConsumer consumer = session.CreateConsumer(dest, "SubPath = 'x'");
> 
> I would not expect any messages to flow through, as they should be
> filtered by SubPath. However, my consumer receives all of the messages.
> Can anyone tell me what I'm doing wrong, or whether there's a way I can
> turn up the logging to see why the selector isn't filtering out these
> messages?
> 
> As an aside, am I right in thinking you can't create non-temporary topics
> using NMS?
> 
> Thanks,
> 
> Jim
> 
> 

-- 
View this message in context: http://www.nabble.com/Message-Selector-Not-Filtering-Messages-tf3870553s2354.html#a10977566
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Message Selector Not Filtering Messages

Posted by Dris <ch...@hotmail.com>.
I think the issue with selectors not working is a bug in NMS. I posted a fix
to the Issuer Tracker for NMS a while back, but I'm not sure if anyone has
had a chance to look at it. As far as I can see the selector is being set to
null before being used, so it never works. I just changed my source code for
NMS (see my post) and rebuilt it and selectors now seem to work for me.

Chris



-- 
View this message in context: http://www.nabble.com/Message-Selector-Not-Filtering-Messages-tf3870553s2354.html#a11035767
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Using JManage 2.0

Posted by James Strachan <ja...@gmail.com>.
On 6/5/07, Jim Alateras <ji...@comware.com.au> wrote:
> Got it. It is the same uri as i use for jconsole
> (service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi).  I am using the
> JSR160 Application type to connect/
>
> First impressions of JManage are very positive.

Cool thanks for the heads up

BTW Hyperic is also worth a look

http://www.hyperic.com/

-- 
James
-------
http://macstrac.blogspot.com/

Re: Using JManage 2.0

Posted by Jim Alateras <ji...@comware.com.au>.
Got it. It is the same uri as i use for jconsole 
(service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi).  I am using the 
JSR160 Application type to connect/

First impressions of JManage are very positive.


cheers
</jima>
Jim Alateras wrote:
> Hi,
> 
> I've been able to use jconsole to connect to the JMX  instance of my 
> embedded broker but was wondering whether anyone has managed to use 
> JManage 2.0 to manage activemq through it's JMX service offering.
> 
> I have downloaded JManage 2.0 but have been unsuccessful in getting it 
> to attach to activemq's jmx  instance.
> 
> 
> cheers
> </jima>
> 


Using JManage 2.0

Posted by Jim Alateras <ji...@comware.com.au>.
Hi,

I've been able to use jconsole to connect to the JMX  instance of my 
embedded broker but was wondering whether anyone has managed to use 
JManage 2.0 to manage activemq through it's JMX service offering.

I have downloaded JManage 2.0 but have been unsuccessful in getting it 
to attach to activemq's jmx  instance.


cheers
</jima>

Re: Message Selector Not Filtering Messages

Posted by Jim_Cross <ji...@googlemail.com>.
Finally found it in Jira...it's an unresolved issue:
http://issues.apache.org/activemq/browse/AMQNET-44

The work around, passing in the 3rd argument, works for me



Jim_Cross wrote:
> 
> Hi,
> 
> I'm using ActiveMQ with a Java producer and a C# (NMS) consumer.
> Everything seems to be working, except my message selectors, which don't
> filter out any messages.
> For example, if I use the following in my producer:
> 
> TextMessage testMessage = session.createTextMessage();
> testMessage.setStringProperty("URI",
> "http://localhost/slide/files/data/test/text.txt");
> testMessage.setStringProperty("SubPath", "data/test");
> testMessage.setText(content);
> producer.send(testMessage);
> 
> And this in the consumer:
> 
> IMessageConsumer consumer = session.CreateConsumer(dest, "SubPath = 'x'");
> 
> I would not expect any messages to flow through, as they should be
> filtered by SubPath. However, my consumer receives all of the messages.
> Can anyone tell me what I'm doing wrong, or whether there's a way I can
> turn up the logging to see why the selector isn't filtering out these
> messages?
> 
> As an aside, am I right in thinking you can't create non-temporary topics
> using NMS?
> 
> Thanks,
> 
> Jim
> 
> 

-- 
View this message in context: http://www.nabble.com/Message-Selector-Not-Filtering-Messages-tf3870553s2354.html#a10991784
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Message Selector Not Filtering Messages

Posted by Jim_Cross <ji...@googlemail.com>.
Just tried the same thing with a Java client, and the filtereing works fine,
so it seems to be an issue with NMS and message selectors.

Any ideas anyone?

Jim


Jim_Cross wrote:
> 
> Hi,
> 
> I'm using ActiveMQ with a Java producer and a C# (NMS) consumer.
> Everything seems to be working, except my message selectors, which don't
> filter out any messages.
> For example, if I use the following in my producer:
> 
> TextMessage testMessage = session.createTextMessage();
> testMessage.setStringProperty("URI",
> "http://localhost/slide/files/data/test/text.txt");
> testMessage.setStringProperty("SubPath", "data/test");
> testMessage.setText(content);
> producer.send(testMessage);
> 
> And this in the consumer:
> 
> IMessageConsumer consumer = session.CreateConsumer(dest, "SubPath = 'x'");
> 
> I would not expect any messages to flow through, as they should be
> filtered by SubPath. However, my consumer receives all of the messages.
> Can anyone tell me what I'm doing wrong, or whether there's a way I can
> turn up the logging to see why the selector isn't filtering out these
> messages?
> 
> As an aside, am I right in thinking you can't create non-temporary topics
> using NMS?
> 
> Thanks,
> 
> Jim
> 
> 

-- 
View this message in context: http://www.nabble.com/Message-Selector-Not-Filtering-Messages-tf3870553s2354.html#a10991517
Sent from the ActiveMQ - User mailing list archive at Nabble.com.