camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From XiaoLi Ding <xld...@talend.com>
Subject how to work for redelivery of onException?
Date Sun, 09 Dec 2012 15:47:46 GMT
hi,

i want to know how where happen asynchronization for "Asynchronous delayed redelivery" when
i use Exception clause.my code as follows:
=============================================
        onException(java.io.IOException.class)

       .handled(true).maximumRedeliveries(3).asyncDelayedRedelivery().routeId("cOnException_1")
            .process(new org.apache.camel.Processor() {
                public void process(org.apache.camel.Exchange exchange) throws Exception {
                    long tid = Thread.currentThread().getId();
                    System.out.println("after break out thread id = " + tid);

                }

            }).id("cProcessor_1");
        from("timer:myTimer2?repeatCount=1").routeId("cTimer_2").process(new org.apache.camel.Processor()
{
            public void process(org.apache.camel.Exchange exchange) throws Exception {
                long tid = Thread.currentThread().getId();
                System.out.println("Trying thread id = " + tid);
                Thread.sleep(1000);
                throw new java.io.IOException("This is specially generated  java.io.IOException
exception");
            }

        }).id("cProcessor_3").process(new org.apache.camel.Processor() {
            public void process(org.apache.camel.Exchange exchange) throws Exception {

            }

        }).id("cProcessor_2");

===========================================
the result is :
Trying thread id = 11
Trying thread id = 11
Trying thread id = 11
Trying thread id = 11
after break out thread id = 11
why always same thread here?even before handle and after handle the exception?
where should happen asynchronization?

thanks for reply.

Best regards
Xiaoli Ding
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message