camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jimbogaz <jimbo...@gmail.com>
Subject Multicast, redelivery and error handlers
Date Wed, 12 Sep 2012 20:37:25 GMT
Hi all.

I think I'm missing something obvious, but I can't find anything here that
is similar to my problem, or any docs that tell me "it's obvious James you
twerp":

I've put together a route that multicasts to three direct routes, which
simply return setBody type responses.  I have intentionally made one of them
take longer than the timeout on the multicast, with the intention that the
error handler retries the request.  It doesn't.  I have tried with both
having a TimeoutAwareAggregationStrategy with a setException (which I
thought would automatically invoke the error handler), and with just a plain
AggregationStrategy.

I'm on Camel 2.9.3, and below are my (sanitised to protect my client)
sections from beans.xml and my main method...  can anybody tell me where I'm
epic failing?


    public static void main(String... args) throws Exception {
    	ApplicationContext appContext = new
ClassPathXmlApplicationContext("beans.xml");
    	LOG.info("Initialised Application Context");
    	CamelContext camelContext = appContext.getBean("camel-context",
CamelContext.class);
    	ProducerTemplate producerTemplate =
camelContext.createProducerTemplate();
    	producerTemplate.asyncCallbackRequestBody("direct:blah",
"<identity><name>James</name>dude@thingy.com</identity>", callback);
    	Thread.sleep(15000);
    	LOG.info("FINISHED");
    }

  <camel:camelContext id="camel-context" errorHandlerRef="defaultEH"
xmlns="http://camel.apache.org/schema/spring">
    <camel:package>com.rightmess.camel</camel:package>
    
        <camel:errorHandler id="defaultEH">
            <camel:redeliveryPolicy maximumRedeliveries="2"
retryAttemptedLogLevel="WARN" redeliveryDelay="200"/>
        </camel:errorHandler>
    <camel:route>
      <camel:from uri="direct:blah"/>
      <camel:multicast strategyRef="aggregatedData"
                   parallelProcessing="true" streaming="true" timeout="700">
      	<camel:to uri="direct:DOB"/>
      	<camel:to uri="direct:Address"/>
      	<camel:to uri="direct:Telephone"/>
      </camel:multicast>
    </camel:route>
    <camel:route>
    	<camel:from uri="direct:DOB"/>
    	<camel:delay><camel:constant>233</camel:constant></camel:delay>
    
<camel:setBody><camel:constant>15/04/1868</camel:constant></camel:setBody>
    </camel:route>
    <camel:route>
    	<camel:from uri="direct:Address"/>
    	<camel:delay><camel:constant>1500</camel:constant></camel:delay>
    
<camel:setBody><camel:constant>Starbucks</camel:constant></camel:setBody>
    	<camel:to uri="log:log"/>
    </camel:route>
    <camel:route>
    	<camel:from uri="direct:Telephone"/>
    	<camel:delay><camel:constant>233</camel:constant></camel:delay>
    
<camel:setBody><camel:constant>0982734786238746</camel:constant></camel:setBody>
    </camel:route>
  </camel:camelContext>
  




--
View this message in context: http://camel.465427.n5.nabble.com/Multicast-redelivery-and-error-handlers-tp5719208.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message