You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by io42 <in...@desknetinc.com> on 2012/01/05 21:10:46 UTC
Filtering by Message subtype (e.g. TextMessage, MapMessage)
Is it possible for a consumer to filter incoming messages based on the
message sub-type (e.g. Only receive MapMessage objects and TextMessage
objects from a queue, but not any StreamMessage objects that are on that
queue)? If so, how?
--
View this message in context: http://activemq.2283324.n4.nabble.com/Filtering-by-Message-subtype-e-g-TextMessage-MapMessage-tp4266841p4266841.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
Re: Filtering by Message subtype (e.g. TextMessage, MapMessage)
Posted by io42 <in...@desknetinc.com>.
Thanks for the suggestion, but unless I'm doing something wrong this doesn't
work. I set the selector to:
JMSXMimeType = 'jms/text-message'
and this did not work. I was using a standard JMS Session, though, to
create a JMS MessageConsumer, and not an ActiveMQSession or
ActiveMQMessaegeConsumer. Might this make a difference? I'm having a
difficult time trying to create a ActiveMQSession since the
ActiveMQconnectionFactory seems to create a Connection instead of an
ActiveMQConnection.
Unfortunately not all producer-side messages are controlled by the code that
I am working on.
--
View this message in context: http://activemq.2283324.n4.nabble.com/Filtering-by-Message-subtype-e-g-TextMessage-MapMessage-tp4266841p4276758.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
Re: Filtering by Message subtype (e.g. TextMessage, MapMessage)
Posted by Dejan Bosanac <de...@nighttale.net>.
Didn't try it but you can see if you can set selector against
"JMSXMimeType" which is available for ActiveMQ messages and text message
has value "jms/text-message" for example. If not, and you control producer
side you can set different JMSType on different type of messages when
you're sending them and filter on that
Regards
--
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net
On Thu, Jan 5, 2012 at 9:10 PM, io42 <in...@desknetinc.com> wrote:
> Is it possible for a consumer to filter incoming messages based on the
> message sub-type (e.g. Only receive MapMessage objects and TextMessage
> objects from a queue, but not any StreamMessage objects that are on that
> queue)? If so, how?
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Filtering-by-Message-subtype-e-g-TextMessage-MapMessage-tp4266841p4266841.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>