You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Terrk K <ty...@thomson.com> on 2007/10/11 00:24:51 UTC

message selectors

I cannot find enough documentation on message selectors but have many
questions.

Message selectors are more like fliters right? If so, what is the underlying
selection policy of the broker? Age, priority, moon phases?

I want batch select messages belonging to some logical group, i.e. some id
where one of the messages is a very high priority. Put another way, i want
to pick off the oldest, highest prioity message and all other messages
identified with the same id (I may as well process all such messages in a
single batch right?).

What is a standard way of doing this? Multiple session selectors?

How does one filter messages without literals but fliter them based on other
messages? e.g 

You can tell I'm new to this. Please advise me if you can.

Thanks
terry k


-- 
View this message in context: http://www.nabble.com/message-selectors-tf4603950s2354.html#a13145936
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: message selectors

Posted by James Strachan <ja...@gmail.com>.
On 12/10/2007, Terry K <ty...@thomson.com> wrote:
>
> .. what worries me at this point is introducing yet anothrer level of
> software complexity to solve what is really a simple requirement. I can see
> a simple database table with a little SQL code could solve this problem.
> What advantage does a JMS Queue (which is not a trivial software
> infrastructure to incorporate) give to this situation?

If you prefer to use a database and your database can handle the
polling frequency and you don't realy need load balancing, go for it.

JMS is designed to be a very high performance reliable load balancer
(queues) or high performance publish & subscribe network. A message
queue is semantically very different to a database (which uses queries
and locking) - a message queue has no locking and is stream based.

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

Open Source SOA
http://open.iona.com

Re: message selectors

Posted by Terry K <ty...@thomson.com>.
.. what worries me at this point is introducing yet anothrer level of
software complexity to solve what is really a simple requirement. I can see
a simple database table with a little SQL code could solve this problem.
What advantage does a JMS Queue (which is not a trivial software
infrastructure to incorporate) give to this situation?



James.Strachan wrote:
> 
> On 11/10/2007, Terry K <ty...@thomson.com> wrote:
>>
>> ... thanks for the suggestions - message groups do sound like a plausible
>> solution.
>>
>> I am not interested in assigning a group of messages to particular
>> sessions
>> indefinately as the groups will be small and many. Once the high priority
>> message has been dequeued with all related messages (at that point in
>> time)
>> that batch work is done and time to move onto the next high priority
>> message.
> 
> If you basically want to reorder a queue so that high priority
> messages are processed first; with their related messages before
> others, you maybe need this...
> http://activemq.apache.org/camel/resequencer.html
> 
> to reorder messages on the queue before they hit your consumer
> 
> 
>> CorrelationID's also look promising. High do you create a message
>> selector
>> string to select by comparisons to other messages
> 
> A JMS selector only performs a boolean expression on the current
> message only - not on a window of previous messages
> 
> 
>>  e.g. CorrelationID and
>> Priorty? I can see how this is done in the JMS Message javadoc API. All
>> documentation seems to relate to literal comparisons
> 
> See
> http://activemq.apache.org/how-do-i-use-jms-efficiently.html
> 
> with JMS if you want high performance you typically don't wanna be
> starting/stopping subscriptions as you process individual messages.
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/message-selectors-tf4603950s2354.html#a13166731
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: message selectors

Posted by James Strachan <ja...@gmail.com>.
On 11/10/2007, Terry K <ty...@thomson.com> wrote:
>
> ... thanks for the suggestions - message groups do sound like a plausible
> solution.
>
> I am not interested in assigning a group of messages to particular sessions
> indefinately as the groups will be small and many. Once the high priority
> message has been dequeued with all related messages (at that point in time)
> that batch work is done and time to move onto the next high priority
> message.

If you basically want to reorder a queue so that high priority
messages are processed first; with their related messages before
others, you maybe need this...
http://activemq.apache.org/camel/resequencer.html

to reorder messages on the queue before they hit your consumer


> CorrelationID's also look promising. High do you create a message selector
> string to select by comparisons to other messages

A JMS selector only performs a boolean expression on the current
message only - not on a window of previous messages


>  e.g. CorrelationID and
> Priorty? I can see how this is done in the JMS Message javadoc API. All
> documentation seems to relate to literal comparisons

See
http://activemq.apache.org/how-do-i-use-jms-efficiently.html

with JMS if you want high performance you typically don't wanna be
starting/stopping subscriptions as you process individual messages.


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

Open Source SOA
http://open.iona.com

Re: message selectors

Posted by Terry K <ty...@thomson.com>.
... thanks for the suggestions - message groups do sound like a plausible
solution.

I am not interested in assigning a group of messages to particular sessions
indefinately as the groups will be small and many. Once the high priority
message has been dequeued with all related messages (at that point in time)
that batch work is done and time to move onto the next high priority
message.

CorrelationID's also look promising. High do you create a message selector
string to select by comparisons to other messages e.g. CorrelationID and
Priorty? I can see how this is done in the JMS Message javadoc API. All
documentation seems to relate to literal comparisons

Thanks again.



James.Strachan wrote:
> 
> On 10/10/2007, Terrk K <ty...@thomson.com> wrote:
>>
>> I cannot find enough documentation on message selectors but have many
>> questions.
>>
>> Message selectors are more like fliters right? If so, what is the
>> underlying
>> selection policy of the broker? Age, priority, moon phases?
> 
> The selector describes the filter.
> 
> See the "Message Selectors" section...
> http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html
> 
> 
> As Joe said, Message Groups could be what you need to process groups
> of messages by the same consumer; maybe with a selector to filter
> 'high priority' messages
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/message-selectors-tf4603950s2354.html#a13155279
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: message selectors

Posted by James Strachan <ja...@gmail.com>.
On 10/10/2007, Terrk K <ty...@thomson.com> wrote:
>
> I cannot find enough documentation on message selectors but have many
> questions.
>
> Message selectors are more like fliters right? If so, what is the underlying
> selection policy of the broker? Age, priority, moon phases?

The selector describes the filter.

See the "Message Selectors" section...
http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html


As Joe said, Message Groups could be what you need to process groups
of messages by the same consumer; maybe with a selector to filter
'high priority' messages

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

Open Source SOA
http://open.iona.com

Re: message selectors

Posted by ttmdev <jo...@ttmsolutions.com>.
Sounds to me like "Message Groups" may be what you're looking for. 

http://activemq.apache.org/message-groups.html

Joe



Terry K wrote:
> 
> I cannot find enough documentation on message selectors but have many
> questions.
> 
> Message selectors are more like fliters right? If so, what is the
> underlying selection policy of the broker? Age, priority, moon phases?
> 
> I want batch select messages belonging to some logical group, i.e. some id
> where one of the messages is a very high priority. Put another way, i want
> to pick off the oldest, highest prioity message and all other messages
> identified with the same id (I may as well process all such messages in a
> single batch right?).
> 
> What is a standard way of doing this? Multiple session selectors, one to
> select the highest priority then another the get all related messages i.e.
> with the same id?
> 
> How does one filter messages without literals but filter them based on
> other messages? 
> 
> You can tell I'm new to this. Please advise me if you can.
> 
> Thanks
> terry k
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/message-selectors-tf4603950s2354.html#a13154508
Sent from the ActiveMQ - User mailing list archive at Nabble.com.