You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mcrive <mc...@optasportsdata.com> on 2010/01/13 15:28:43 UTC

recipientList retryUntil not working?

I have following route:

from("jms-test:queue:queue.delivery.notification.test")
.process(processor)
.onException(Exception.class).retryUntil(bean("myRetryBean")).end()
.recipientList(header("recipientListHeader").tokenize(","))						
.parallelProcessing().executorService(customThreadPoolExecutor)
.aggregationStrategy(new RecipientAggregationStrategy())
.to("direct:chunk.completed");



bean is registered in such way:
JndiRegistry jndi = new JndiRegistry(new JndiContext());		
jndi.bind("myRetryBean", new RetryBean());


bean class is:
public class RetryBean {

	private int _invoked;
	private Logger _logger;
	
    public RetryBean() {
    	this._logger = Logger.getLogger(RetryBean.class);
    	this._invoked = 0;
    	_logger.debug("BEAN INITIALIZED " + _invoked);
    }
	
    // using bean binding we can bind the information from the exchange to
the types we have in our method signature
    public boolean retryUntil(@Header(Exchange.REDELIVERY_COUNTER) Integer
counter, @Body String body, @ExchangeException Exception causedBy) {
        // NOTE: counter is the redelivery attempt, will start from 1
    	_invoked++;
    	
    	
    	_logger.debug("invoked" + _invoked);
    	_logger.debug("counter" + counter);
    	_logger.debug("result" + (counter < 2));
    	
        // we can of course do what ever we want to determine the result but
this is a unit test so we end after 3 attempts
        return counter < 7;
    }



the bean gets intialized but it looks like the method retryUntil is never
called, could it be an error of implementation? am I doing something wrong?


-- 
View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27145846.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList retryUntil not working?

Posted by mcrive <mc...@optasportsdata.com>.
It was my fault, it is working now!
I forgot to assign the registry to the DefaultCamelContext


JndiRegistry jndi = new JndiRegistry(new JndiContext()); 
jndi.bind("myRetryBean", new RetryBean());	
CamelContext context = new DefaultCamelContext(jndi);

looking into CamelTestSupport turned on the light :)
sorry for having bothered you!

thanks, this forum rocks!



willem.jiang wrote:
> 
> You need to take a look at the code of CamelTestSupport to see how to 
> set up the Registry for the CamelContext, and how to bind the bean's 
> reference in the Registry?
> 
> Then update your code to set up a right Registry.
> 
> Willem
> 
> mcrive wrote:
>> what if I am not using CamelTestSupport?
>> 
>> Stephen Gargan wrote:
>>> If you're using CamelTestSupport you can do the following...
>>>
>>> @Override
>>>     protected Context createJndiContext() throws Exception {
>>>         Context jndi =  super.createJndiContext();
>>>         jndi.bind("myRetryBean", "somebean");
>>>         System.err.println(jndi.lookup("myRetryBean"));
>>>         return jndi;
>>>     }
>>>
>>> On Wed, Feb 10, 2010 at 10:23 AM, mcrive <mc...@optasportsdata.com>
>>> wrote:
>>>> Hi,
>>>> I have built current trunk
>>>> and tried to use retryUntil on my context (see
>>>> https://issues.apache.org/activemq/browse/CAMEL-2360)
>>>>
>>>> Now something happens!
>>>> An exception :) which is a good thing it means the background works!
>>>>
>>>> org.springframework.jms.listener.DefaultMessageListenerContainer  -
>>>> Execution of JMS message listener failed
>>>> org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed
>>>> to
>>>> invoke method: null on myRetryBean due to:
>>>> org.apache.camel.NoSuchBeanException: No bean could be found in the
>>>> registry
>>>> for: myRetryBean
>>>>
>>>>
>>>> how should I add the bean to the registry, at the moment I am doing
>>>> this:
>>>> JndiRegistry jndi = new JndiRegistry(new JndiContext());
>>>> jndi.bind("myRetryBean", new RetryBean());
>>>>
>>>> looking into the unit tests I can't find any sample...
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>> On Thu, Feb 4, 2010 at 9:34 AM, mcrive <mc...@optasportsdata.com>
>>>>> wrote:
>>>>>> is building current trunk another option?
>>>>>>
>>>>> Yeah of course you are welcome to build and try the trunk
>>>>> http://camel.apache.org/building.html
>>>>>
>>>>>> Claus Ibsen-2 wrote:
>>>>>>> On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> mcrive wrote:
>>>>>>>>> I've tried both things you suggested but it is still not working,
>>>>>>>>> the
>>>>>>>>> retry happens in default manner.
>>>>>>>>>
>>>>>>>>> I've opened a ticket in JIRA:
>>>>>>>>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>>>>>>>>
>>>>>>>>>
>>>>>>>> were you able to replicate the issue I am experiencing? I've
>>>>>>>> attached
>>>>>>>> a
>>>>>>>> sample to the ticket.
>>>>>>>>
>>>>>>> I did some fixes which will be in 2.2. So can you try again when
>>>>>>> Camel
>>>>>>> 2.2.0 has been released.
>>>>>>>
>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Claus Ibsen
>>>>>>> Apache Camel Committer
>>>>>>>
>>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>>> Open Source Integration: http://fusesource.com
>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27449274.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Claus Ibsen
>>>>> Apache Camel Committer
>>>>>
>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>> Open Source Integration: http://fusesource.com
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>> Twitter: http://twitter.com/davsclaus
>>>>>
>>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27535743.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27544305.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList retryUntil not working?

Posted by Willem Jiang <wi...@gmail.com>.
You need to take a look at the code of CamelTestSupport to see how to 
set up the Registry for the CamelContext, and how to bind the bean's 
reference in the Registry?

Then update your code to set up a right Registry.

Willem

mcrive wrote:
> what if I am not using CamelTestSupport?
> 
> Stephen Gargan wrote:
>> If you're using CamelTestSupport you can do the following...
>>
>> @Override
>>     protected Context createJndiContext() throws Exception {
>>         Context jndi =  super.createJndiContext();
>>         jndi.bind("myRetryBean", "somebean");
>>         System.err.println(jndi.lookup("myRetryBean"));
>>         return jndi;
>>     }
>>
>> On Wed, Feb 10, 2010 at 10:23 AM, mcrive <mc...@optasportsdata.com>
>> wrote:
>>> Hi,
>>> I have built current trunk
>>> and tried to use retryUntil on my context (see
>>> https://issues.apache.org/activemq/browse/CAMEL-2360)
>>>
>>> Now something happens!
>>> An exception :) which is a good thing it means the background works!
>>>
>>> org.springframework.jms.listener.DefaultMessageListenerContainer  -
>>> Execution of JMS message listener failed
>>> org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
>>> invoke method: null on myRetryBean due to:
>>> org.apache.camel.NoSuchBeanException: No bean could be found in the
>>> registry
>>> for: myRetryBean
>>>
>>>
>>> how should I add the bean to the registry, at the moment I am doing this:
>>> JndiRegistry jndi = new JndiRegistry(new JndiContext());
>>> jndi.bind("myRetryBean", new RetryBean());
>>>
>>> looking into the unit tests I can't find any sample...
>>>
>>>
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>> On Thu, Feb 4, 2010 at 9:34 AM, mcrive <mc...@optasportsdata.com>
>>>> wrote:
>>>>> is building current trunk another option?
>>>>>
>>>> Yeah of course you are welcome to build and try the trunk
>>>> http://camel.apache.org/building.html
>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>> On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com>
>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>> mcrive wrote:
>>>>>>>> I've tried both things you suggested but it is still not working,
>>>>>>>> the
>>>>>>>> retry happens in default manner.
>>>>>>>>
>>>>>>>> I've opened a ticket in JIRA:
>>>>>>>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>>>>>>>
>>>>>>>>
>>>>>>> were you able to replicate the issue I am experiencing? I've attached
>>>>>>> a
>>>>>>> sample to the ticket.
>>>>>>>
>>>>>> I did some fixes which will be in 2.2. So can you try again when Camel
>>>>>> 2.2.0 has been released.
>>>>>>
>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Claus Ibsen
>>>>>> Apache Camel Committer
>>>>>>
>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>> Open Source Integration: http://fusesource.com
>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>
>>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27449274.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27535743.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
> 


Re: recipientList retryUntil not working?

Posted by mcrive <mc...@optasportsdata.com>.
what if I am not using CamelTestSupport?

Stephen Gargan wrote:
> 
> If you're using CamelTestSupport you can do the following...
> 
> @Override
>     protected Context createJndiContext() throws Exception {
>         Context jndi =  super.createJndiContext();
>         jndi.bind("myRetryBean", "somebean");
>         System.err.println(jndi.lookup("myRetryBean"));
>         return jndi;
>     }
> 
> On Wed, Feb 10, 2010 at 10:23 AM, mcrive <mc...@optasportsdata.com>
> wrote:
>>
>> Hi,
>> I have built current trunk
>> and tried to use retryUntil on my context (see
>> https://issues.apache.org/activemq/browse/CAMEL-2360)
>>
>> Now something happens!
>> An exception :) which is a good thing it means the background works!
>>
>> org.springframework.jms.listener.DefaultMessageListenerContainer  -
>> Execution of JMS message listener failed
>> org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
>> invoke method: null on myRetryBean due to:
>> org.apache.camel.NoSuchBeanException: No bean could be found in the
>> registry
>> for: myRetryBean
>>
>>
>> how should I add the bean to the registry, at the moment I am doing this:
>> JndiRegistry jndi = new JndiRegistry(new JndiContext());
>> jndi.bind("myRetryBean", new RetryBean());
>>
>> looking into the unit tests I can't find any sample...
>>
>>
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> On Thu, Feb 4, 2010 at 9:34 AM, mcrive <mc...@optasportsdata.com>
>>> wrote:
>>>>
>>>> is building current trunk another option?
>>>>
>>>
>>> Yeah of course you are welcome to build and try the trunk
>>> http://camel.apache.org/building.html
>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> mcrive wrote:
>>>>>>>
>>>>>>> I've tried both things you suggested but it is still not working,
>>>>>>> the
>>>>>>> retry happens in default manner.
>>>>>>>
>>>>>>> I've opened a ticket in JIRA:
>>>>>>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> were you able to replicate the issue I am experiencing? I've attached
>>>>>> a
>>>>>> sample to the ticket.
>>>>>>
>>>>>
>>>>> I did some fixes which will be in 2.2. So can you try again when Camel
>>>>> 2.2.0 has been released.
>>>>>
>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Claus Ibsen
>>>>> Apache Camel Committer
>>>>>
>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>> Open Source Integration: http://fusesource.com
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>> Twitter: http://twitter.com/davsclaus
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27449274.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27535743.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27543553.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList retryUntil not working?

Posted by Stephen Gargan <st...@gmail.com>.
If you're using CamelTestSupport you can do the following...

@Override
    protected Context createJndiContext() throws Exception {
        Context jndi =  super.createJndiContext();
        jndi.bind("myRetryBean", "somebean");
        System.err.println(jndi.lookup("myRetryBean"));
        return jndi;
    }

On Wed, Feb 10, 2010 at 10:23 AM, mcrive <mc...@optasportsdata.com> wrote:
>
> Hi,
> I have built current trunk
> and tried to use retryUntil on my context (see
> https://issues.apache.org/activemq/browse/CAMEL-2360)
>
> Now something happens!
> An exception :) which is a good thing it means the background works!
>
> org.springframework.jms.listener.DefaultMessageListenerContainer  -
> Execution of JMS message listener failed
> org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
> invoke method: null on myRetryBean due to:
> org.apache.camel.NoSuchBeanException: No bean could be found in the registry
> for: myRetryBean
>
>
> how should I add the bean to the registry, at the moment I am doing this:
> JndiRegistry jndi = new JndiRegistry(new JndiContext());
> jndi.bind("myRetryBean", new RetryBean());
>
> looking into the unit tests I can't find any sample...
>
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Thu, Feb 4, 2010 at 9:34 AM, mcrive <mc...@optasportsdata.com> wrote:
>>>
>>> is building current trunk another option?
>>>
>>
>> Yeah of course you are welcome to build and try the trunk
>> http://camel.apache.org/building.html
>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com>
>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>> mcrive wrote:
>>>>>>
>>>>>> I've tried both things you suggested but it is still not working, the
>>>>>> retry happens in default manner.
>>>>>>
>>>>>> I've opened a ticket in JIRA:
>>>>>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>>>>>
>>>>>>
>>>>>
>>>>> were you able to replicate the issue I am experiencing? I've attached a
>>>>> sample to the ticket.
>>>>>
>>>>
>>>> I did some fixes which will be in 2.2. So can you try again when Camel
>>>> 2.2.0 has been released.
>>>>
>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27449274.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27535743.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Re: recipientList retryUntil not working?

Posted by mcrive <mc...@optasportsdata.com>.
Hi,
I have built current trunk
and tried to use retryUntil on my context (see
https://issues.apache.org/activemq/browse/CAMEL-2360)

Now something happens!
An exception :) which is a good thing it means the background works!

org.springframework.jms.listener.DefaultMessageListenerContainer  -
Execution of JMS message listener failed
org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
invoke method: null on myRetryBean due to:
org.apache.camel.NoSuchBeanException: No bean could be found in the registry
for: myRetryBean


how should I add the bean to the registry, at the moment I am doing this:
JndiRegistry jndi = new JndiRegistry(new JndiContext()); 
jndi.bind("myRetryBean", new RetryBean());

looking into the unit tests I can't find any sample...





Claus Ibsen-2 wrote:
> 
> On Thu, Feb 4, 2010 at 9:34 AM, mcrive <mc...@optasportsdata.com> wrote:
>>
>> is building current trunk another option?
>>
> 
> Yeah of course you are welcome to build and try the trunk
> http://camel.apache.org/building.html
> 
>>
>> Claus Ibsen-2 wrote:
>>>
>>> On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com>
>>> wrote:
>>>>
>>>>
>>>>
>>>> mcrive wrote:
>>>>>
>>>>> I've tried both things you suggested but it is still not working, the
>>>>> retry happens in default manner.
>>>>>
>>>>> I've opened a ticket in JIRA:
>>>>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>>>>
>>>>>
>>>>
>>>> were you able to replicate the issue I am experiencing? I've attached a
>>>> sample to the ticket.
>>>>
>>>
>>> I did some fixes which will be in 2.2. So can you try again when Camel
>>> 2.2.0 has been released.
>>>
>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27449274.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27535743.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList retryUntil not working?

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 4, 2010 at 9:34 AM, mcrive <mc...@optasportsdata.com> wrote:
>
> is building current trunk another option?
>

Yeah of course you are welcome to build and try the trunk
http://camel.apache.org/building.html

>
> Claus Ibsen-2 wrote:
>>
>> On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com> wrote:
>>>
>>>
>>>
>>> mcrive wrote:
>>>>
>>>> I've tried both things you suggested but it is still not working, the
>>>> retry happens in default manner.
>>>>
>>>> I've opened a ticket in JIRA:
>>>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>>>
>>>>
>>>
>>> were you able to replicate the issue I am experiencing? I've attached a
>>> sample to the ticket.
>>>
>>
>> I did some fixes which will be in 2.2. So can you try again when Camel
>> 2.2.0 has been released.
>>
>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27449274.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: recipientList retryUntil not working?

Posted by mcrive <mc...@optasportsdata.com>.
is building current trunk another option?


Claus Ibsen-2 wrote:
> 
> On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com> wrote:
>>
>>
>>
>> mcrive wrote:
>>>
>>> I've tried both things you suggested but it is still not working, the
>>> retry happens in default manner.
>>>
>>> I've opened a ticket in JIRA:
>>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>>
>>>
>>
>> were you able to replicate the issue I am experiencing? I've attached a
>> sample to the ticket.
>>
> 
> I did some fixes which will be in 2.2. So can you try again when Camel
> 2.2.0 has been released.
> 
> 
>> --
>> View this message in context:
>> http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27449274.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList retryUntil not working?

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Feb 3, 2010 at 2:40 PM, mcrive <mc...@optasportsdata.com> wrote:
>
>
>
> mcrive wrote:
>>
>> I've tried both things you suggested but it is still not working, the
>> retry happens in default manner.
>>
>> I've opened a ticket in JIRA:
>> https://issues.apache.org/activemq/browse/CAMEL-2360
>>
>>
>
> were you able to replicate the issue I am experiencing? I've attached a
> sample to the ticket.
>

I did some fixes which will be in 2.2. So can you try again when Camel
2.2.0 has been released.


> --
> View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: recipientList retryUntil not working?

Posted by mcrive <mc...@optasportsdata.com>.


mcrive wrote:
> 
> I've tried both things you suggested but it is still not working, the
> retry happens in default manner.
> 
> I've opened a ticket in JIRA:
> https://issues.apache.org/activemq/browse/CAMEL-2360
> 
> 

were you able to replicate the issue I am experiencing? I've attached a
sample to the ticket.

-- 
View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27436399.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList retryUntil not working?

Posted by mcrive <mc...@optasportsdata.com>.
I've tried both things you suggested but it is still not working, the retry
happens in default manner.

I've opened a ticket in JIRA:
https://issues.apache.org/activemq/browse/CAMEL-2360



Claus Ibsen-2 wrote:
> 
> Hi
> 
> Can you try moving the onException on up?
> 
> And if still a problem then try using onException as context scoped,
> eg outside the from
> 
> Just to see if that resolves anything.
> 
> I am a tad busy with a couple of other issues, but let me know how goes.
> And if still a problem then create a JIRA so we can get it resolved for
> 2.2.
> 
> 
-- 
View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27159028.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList retryUntil not working?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Can you try moving the onException on up?

And if still a problem then try using onException as context scoped,
eg outside the from

Just to see if that resolves anything.

I am a tad busy with a couple of other issues, but let me know how goes.
And if still a problem then create a JIRA so we can get it resolved for 2.2.


On Wed, Jan 13, 2010 at 3:28 PM, mcrive <mc...@optasportsdata.com> wrote:
>
> I have following route:
>
> from("jms-test:queue:queue.delivery.notification.test")
> .process(processor)
> .onException(Exception.class).retryUntil(bean("myRetryBean")).end()
> .recipientList(header("recipientListHeader").tokenize(","))
> .parallelProcessing().executorService(customThreadPoolExecutor)
> .aggregationStrategy(new RecipientAggregationStrategy())
> .to("direct:chunk.completed");
>
>
>
> bean is registered in such way:
> JndiRegistry jndi = new JndiRegistry(new JndiContext());
> jndi.bind("myRetryBean", new RetryBean());
>
>
> bean class is:
> public class RetryBean {
>
>        private int _invoked;
>        private Logger _logger;
>
>    public RetryBean() {
>        this._logger = Logger.getLogger(RetryBean.class);
>        this._invoked = 0;
>        _logger.debug("BEAN INITIALIZED " + _invoked);
>    }
>
>    // using bean binding we can bind the information from the exchange to
> the types we have in our method signature
>    public boolean retryUntil(@Header(Exchange.REDELIVERY_COUNTER) Integer
> counter, @Body String body, @ExchangeException Exception causedBy) {
>        // NOTE: counter is the redelivery attempt, will start from 1
>        _invoked++;
>
>
>        _logger.debug("invoked" + _invoked);
>        _logger.debug("counter" + counter);
>        _logger.debug("result" + (counter < 2));
>
>        // we can of course do what ever we want to determine the result but
> this is a unit test so we end after 3 attempts
>        return counter < 7;
>    }
>
>
>
> the bean gets intialized but it looks like the method retryUntil is never
> called, could it be an error of implementation? am I doing something wrong?
>
>
> --
> View this message in context: http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27145846.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus