activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <james.strac...@gmail.com>
Subject Re: Priority message
Date Tue, 15 Jun 2010 12:32:18 GMT
On 15 June 2010 13:03, astlm <monica.astudillo@tic.alten.es> wrote:
>
> The first, thank you for the answer.
>
>
> James.Strachan wrote:
>>
>> On 15 June 2010 07:54, astlm <monica.astudillo@tic.alten.es> wrote:
>>>
>>> I'm sorry but I did not understand how Resequencer work on, I have read
>>> in
>>> more detail how it works, and although not ideal, because only order a
>>> number of messages or messages received over a period time, It can be a
>>> solution.
>>
>> Thats how priority queues work too. How else can you know how long or
>> how many messages to reorder?
>>
>> You are right.
>> I was thought that every message recived to be placed in the correct
>> position according to their priority, instead of waiting for a number of
>> messages or to place, but I guess is that this is very hard and slow.
>>
>>> I think I have to define two queues, one for input and another oner for
>>> output.
>>
>> Correct. It also lets you sort on much more fine grained things -
>> including expressions which extract values from your message payload
>> too if JMSPriority is not enough.
>>
>>
>>> Is only necesary to define on broker.xml the Resequencer?
>>>
>>> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>>>  <route>
>>>    <from uri="input" />
>>>    <resequence>
>>>      <simple>body</simple>
>>>      <to uri="output" />
>>>      <batch-config batchSize="300" batchTimeout="4000"
>>> allowDuplicates=true reverse=true />
>>>    </resequence>
>>>  </route>
>>> </camelContext>
>>>
>>> With these configuration, The producer connect with input queue and the
>>> consumer with output queue.
>>
>> You can put the above XML into any spring XML in any JVM really;
>> though feel free to use it in the broker's XML file.
>>
>> I use activemq 5.3.2 with camel 2.2.0, according to specification,
>> allowDuplicates and reverse are available from the camel 2.4.
>> http://camel.apache.org/resequencer.html
>> Any activemq version have camel 2.4?

Yes - you can use newer Camel releases with older ActiveMQ releases typically.

>> I tried download camel 2.4, but It´s not avalilable.
>> http://camel.apache.org/download.html

2.4 isn't released yet I'm afraid - 2.3 is the most recent release.
You can use 2.4-SNAPSHOT for now if you like.


>> I have a resequencer by JMSPriority, but It doesn`t get reverse orden and
>> It doesn´t allow duplicates.

To reverse order you could use an expression like "100 -
headers.JMSPriority" (it depends on which expression language you use
with Camel - that would certainly work using bean expressions,
javascript, XPath / XQuery, EL etc). Not 100% sure if simple language
supports subtraction though.

To remove duplicates you could use idempotent consumer before the
resequencer to filter out duplicates...
http://camel.apache.org/idempotent-consumer.html

Though waiting for 2.4 might be easiest for you?

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

Open Source Integration
http://fusesource.com/

Mime
View raw message