You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Jeff Sprankle (JIRA)" <ji...@apache.org> on 2010/03/10 22:07:44 UTC

[jira] Created: (CAMEL-2537) Batch Resequencer

Batch Resequencer 
------------------

                 Key: CAMEL-2537
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.0.0
            Reporter: Jeff Sprankle


My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.

# The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
# According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.

If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58165#action_58165 ] 

Claus Ibsen commented on CAMEL-2537:
------------------------------------

Jeff, we love contributions
http://camel.apache.org/contributing.html

So you may consider help with the wiki documentation etc.

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Jeff Sprankle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Sprankle updated CAMEL-2537:
---------------------------------

    Summary: Batch Resequencer issues with JMSPriority  (was: Batch Resequencer )

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58167#action_58167 ] 

Claus Ibsen commented on CAMEL-2537:
------------------------------------

No you cannot resequence based on JMSPriority as its not an unique number as you also say.

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59942#action_59942 ] 

Claus Ibsen commented on CAMEL-2537:
------------------------------------

Added option {{allowDuplicates}} to batch mode of resequencer.

trunk: 951440.

This at least allows us to resequence by JMSPriority where messages will have the same priority.
Next challenge is to allow to invert the expression so you can have the most important first outgoing.

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.4.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Mark You (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59994#action_59994 ] 

Mark You commented on CAMEL-2537:
---------------------------------

Great job. Thanks for help about this improvement. 

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.4.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59943#action_59943 ] 

Claus Ibsen commented on CAMEL-2537:
------------------------------------

Added {{reverse}} option so you can have JMSPriority ordered by 9..0 so the 9's is send out first.

So by using {{reverse + allowDuplicates}} you should be able to resequence jms messages

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.4.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2537.
--------------------------------

    Resolution: Fixed

Updated wiki pages with details about how to use the resequencer for re-ordering jmspriority messages

See also this unit test
http://svn.apache.org/viewvc?rev=952085&view=rev

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.4.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2537.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.0
         Assignee: Claus Ibsen

I have fixed the wiki documentation
http://cwiki.apache.org/confluence/display/CAMEL/Resequencer

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Mark You (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59380#action_59380 ] 

Mark You edited comment on CAMEL-2537 at 5/17/10 12:08 AM:
-----------------------------------------------------------

I don't see any change in batch mode description about unique number, but in stream mode,  the wiki says the message should have unique sequence number. I think original problem is resequencer batch mode should support duplicate priority number, otherwise we can't use this pattern to do priority queue.

For example:
     In common sense, we usually define a limit number of priorities: 1, 2, 3, 4, 5 for example. And we just want to sort them based on priority. So there is always duplication in priority in this case. 

I think the resequencer batch mode should support this case, otherwise it will be uselesss.

My solution in this case will have to order condition, one is priority above, other is a unique number generated by UUID.randonUUID().

resequencer(header(ResourceManagerConstant.PRIORITY), header(ResourceManagerConstant.UUID)

But I don't think it's a good solution.

      was (Author: markyou):
    I don't see any change in batch mode description about unique number, but in stream mode,  the wiki says the message should have unique sequence number. I think original problem is resequencer batch mode should support duplicate priority number, otherwise we can't use this pattern to do priority queue.

For example:
     In common sense, we usually define a limit number of priorities: 1, 2, 3, 4, 5 for example. And we just want to sort them based on priority. So there is always duplication in priority in this case. 

I think the resequencer batch mode should support this case, otherwise it will be uselesss.
  
> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58161#action_58161 ] 

Willem Jiang commented on CAMEL-2537:
-------------------------------------

Do you use camel resequencer to do this job? If so can you show us with your test case.
In this way, we can dig the issue more easily.

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Mark You (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59380#action_59380 ] 

Mark You commented on CAMEL-2537:
---------------------------------

I don't see any change in batch mode description about unique number, but in stream mode,  the wiki says the message should have unique sequence number. I think original problem is resequencer batch mode should support duplicate priority number, otherwise we can't use this pattern to do priority queue.

For example:
     In common sense, we usually define a limit number of priorities: 1, 2, 3, 4, 5 for example. And we just want to sort them based on priority. So there is always duplication in priority in this case. 

I think the resequencer batch mode should support this case, otherwise it will be uselesss.

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-2537:
-------------------------------

    Fix Version/s: 2.4.0
                       (was: 2.3.0)

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.4.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (CAMEL-2537) Batch Resequencer issues with JMSPriority

Posted by "Mark You (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark You reopened CAMEL-2537:
-----------------------------


Hi Claus:
     About priority control implementation, the ActiveMq web site suggest two solution, one is resequencer patter, another is concurrent consumer number setting.

     I think resequencer support in camel with batch mode should support non unique priority order condition, because we often define several priority level.

For example, we define 1~5 priority, 1 is the highest priority and 5 is lowest priority. And we send 100 message into job queue. So there will be some messages with 1 priority and some messages with 2...

And we can use resequencer to do an order, and dispatch to a process queue, which can solve priority control problem.

I think the batch mode in resequecer support should support non unique property, and it will be a good feature to use.

> Batch Resequencer issues with JMSPriority
> -----------------------------------------
>
>                 Key: CAMEL-2537
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2537
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Jeff Sprankle
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> My project uses ActiveMQ and we have a requirement to support priority queues for one or more of our configured queues.  One of the suggestions under the ActiveMQ FAQ is to use a Resequencer, so I followed the link and applied the <resequence> element to my XML-based route.  While testing this functionality we uncovered a couple issues that seem like they should be addressed in a future release of camel-core.
> # The JMSPriority header is not a unique field and internally the Resequencer class uses java.util.Set to collect messages into a batch.  This means that a given batch cannot contain multiple messages with the same JMSPriority.  For example, if I use the default batch config and submit five messages with JMSPriority=6 to the queue within a second, only one of those message is delivered to the configured endpoint.
> # According to the JMS API, priority has ten values where 0 is the lowest and 9 is the highest.  This means that messages with higher priorities should be processed before messages with lower priorities.  When I configure my resequencer with <header>JMSPriority</header>, however, it by default orders the messages within the batch in ascending order which means that messages with lower priorities are processed first.
> If there are any known workarounds to these issues please document them, because the current Resequencer documentation that uses JMSPriority as an example is misleading.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.