camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: custom consumer doesn't change the delay
Date Mon, 21 Sep 2015 14:31:16 GMT
Hi

I think we fixed a bug in that delay stuff. Can you try with latest release?

On Mon, Sep 21, 2015 at 2:46 PM, peter_ce <p.neu@cenit.de> wrote:
> Hi
>
> my custom component won't change the delay for the polling events. The
> consumer inherits from ScheduledPollConsumer and sets the delay with
> setDelay().
> Once Camel
> (org.apache.camel.impl.EventDrivenConsumerRoute.addServices(List<Service>))
> creates it, the delay will be set back to default (500ms). Looks like some
> weird magic which i can't grasp.
>
> My class looks like this:
>
> import org.apache.camel.Exchange;
> import org.apache.camel.Processor;
> import org.apache.camel.impl.ScheduledPollConsumer;
>
> public class PollTestConsumer extends ScheduledPollConsumer {
>
>         private final PollTestConsumerConfiguration configuration;
>
>         public PollTestConsumer(final PollTestEndpoint endpoint, final Processor
> processor) {
>                 super(endpoint, processor);
>                 this.configuration = endpoint.getConsumerConfig();
>
>                 setDelay(7500);
>         }
>
>         @Override
>         protected int poll() throws Exception {
>                 Exchange exchange = getEndpoint().createExchange();
>                 processExchange(exchange);
>
>                 return 1;
>         }
>
>         private void processExchange(final Exchange exchange) throws Exception {
>                 try {
>                         getProcessor().process(exchange);
>                 }
>                 catch (Exception e) {
>                         throw e;
>                 }
>         }
> }
>
> I wonder if my usage is wrong.
>
> The setup is Karaf 3.0.4 and Camel 2.15.2.
> I updated recently from Karaf 2.3.2 and Camel 2.11.1. With this setup it
> worked well.
>
>
> Thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/custom-consumer-doesn-t-change-the-delay-tp5771708.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition

Mime
View raw message