[ 
https://issues.apache.org/jira/browse/CAMEL-3211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411716#comment-13411716
 ] 

Claus Ibsen commented on CAMEL-3211:
------------------------------------

Well I fear that when you offer a functionality that seems so easy, eg 
pollMultiple = true (eg just set a boolean to true), then people may fall into 
a trap, and think it just works as easy as well.

Even if we document that this option has many caveat and you should use it with 
care, we see many people on the mailing list, that dont read javadoc / eip docs 
/ and whatever. And this is not something we can do much about. Its just how 
the world works today.

About your use case, to drain a JMS error queue, then the current code is 
actually worse, as the consumed messages will be acked on the JMS broker one by 
one, so you can lose messages if Camel crashes, or the likes.

I think we should consider having a new EIP for this use-case as the current 
pollEnrich is designed to consume a single message, eg to be a counter-part to 
poll which is actually producing to an endpoint.

Until we have a comprehensive implementation that can support a new EIP / DSL, 
I suggest to start with a helper class (as you say), and then work our ways 
there.

The current code is too weak, and open up a can of worms for the end users.
                
> Enrich and PollEnrich - Option to let it poll multiple messages
> ---------------------------------------------------------------
>
>                 Key: CAMEL-3211
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3211
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Ben O'Day
>            Priority: Minor
>             Fix For: 2.11
>
>
> Think about if we can enhance enrich and/or pollEnrich to be able to poll 
> multiple messages.
> For example to drain a JMS queue, or a FTP site etc. Currently it polls only 
> 1 message, and the continues.
> With some option to tell it to continue we can have it drain the queue until 
> no more messages.
> Or maybe some expression to tell when to stop. Or have some option in the 
> custom aggregator the end user can set/control if it should continue or poll 
> more.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to