You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michele <mi...@finconsgroup.com> on 2016/01/28 12:28:56 UTC

Error Handling and Redelivery Policy between routes

Hi everyone,

error handling and redelivery policy do not work fine when a main route
requests enricher from subroute. When an error accours in subroute, the
exception is propagated to main route wich handles it by DLQError handler
but the delivery attempt remains at 1. It is not incremented until the
maximum.

Log message:
Failed delivery for (MessageId: ID-FGBAL201530-55545-1453977437889-9-22 on
ExchangeId: ID-FGBAL201530-55545-1453977437889-9-5).* On delivery attempt:
1* caught: org.apache.camel.CamelExchangeException: JettyClient failed cause
by: Connection refused: no further information.
Exchange[JmsMessage@0x6b2b6e67]. Caused by: [java.net.ConnectException -
Connection refused: no further information]

This is a my route:

<route id="CRM_LoginRoute" errorHandlerRef="NoErrorHandler" >
			<from uri="direct:crm-login" />
				
				<process ref="CRMLoginProcessor" />
				<marshal ref="Gson" />
				<log message="Sent Request login to CRM: ${body}" loggingLevel="INFO"/>
				<inOut
uri="jetty:{{crm.rs.host.name}}:{{crm.rs.port}}{{crm.rs.context.path}}/oauth2/token?throwExceptionOnFailure=true"
/>
				<log message="Received Response login from CRM: ${body}"
loggingLevel="DEBUG"/>
				<unmarshal ref="Gson" />
				<log message="Authentication successful on CRM!" />
		</route>

		
		<route id="ProcessingMessageData_Route" errorHandlerRef="dlqErrorHandler"
>
			<from uri="activemq:queue:IF_CUSTOMER_Inbound-NormalizedTickets" />
					
					<enrich uri="direct:crm-login" strategyRef="OAuthStrategy"
aggregateOnException="false" />

				
				<log message="Token ${in.header.OAuth-Token}" loggingLevel="DEBUG"/>
				<marshal ref="Gson" />
				<setHeader headerName="Content-Type">
					<constant>application/json</constant>
				</setHeader>
				<setHeader headerName="CamelHttpMethod">
					<constant>POST</constant>
				</setHeader>
				<log message="Request sent to CRM: ${body}" loggingLevel="INFO" />
				
				
				<setHeader headerName="CRMInsertTicketPath">
					<simple>
				
jetty:{{crm.rs.host.name}}:{{crm.rs.port}}{{crm.rs.context.path}}/tk_rt_ticket/${in.header.customer-code}/insert?httpClient.idleTimeout=30000
					</simple>
				</setHeader>
				<log message="CRMInsertTicketPath:
$simple{in.header.CRMInsertTicketPath}" />
				<recipientList stopOnException="true" parallelProcessing="false"
streaming="false">
					<header>CRMInsertTicketPath</header>
					<to uri="activemq:queue:IF_CUSTOMER_Inbound-ProcessedTickets" />
				</recipientList>
		</route>

Thanks in advance

Best Regards 

Michele



--
View this message in context: http://camel.465427.n5.nabble.com/Error-Handling-and-Redelivery-Policy-between-routes-tp5776905.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Error Handling and Redelivery Policy between routes

Posted by Michele <mi...@finconsgroup.com>.
Hi Stevenson,

thanks a lot again. Yes, I force the failure in the CRM_LoginRoute that
throws the exception to main route where is defined a DLQ Error Handler.
Redelivery Policy doesn't work because attempts are always 1. Following a
piece of log

08:46:16,113 | INFO  | rmalizedTickets] | DataWithIdempotentStrategy_Route |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | START -
ProcessingMessageData_Route
08:46:16,113 | INFO  | rmalizedTickets] | DataWithIdempotentStrategy_Route |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Processing
Message with IdempotentId 02a17f8e82722d79635d1579e51bc588
08:46:16,113 | INFO  | rmalizedTickets] | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | START -
CRM_LoginRoute
08:46:16,128 | INFO  | rmalizedTickets] | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Sent Request
login to CRM:
{"platform":"base_IF-Customer_1454139976113","username":"admin","client_secret":"","grant_type":"password","client_id":"sugar","password":"admin"}
08:46:16,159 | INFO  | read #27 - Split | NormalizingMessageData_Route     |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | END with
NormalizingMessageData_Route
08:46:17,168 | WARN  | rmalizedTickets] | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
CONNECTION FAILED
ContentExchange@40578943=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1024ms)->EXCEPTED(0ms)
java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.7.0_79]
	at
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)[:1.7.0_79]
	...
08:46:17,168 | WARN  | rmalizedTickets] | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Failed delivery
for (MessageId: ID-FGBAL201530-50468-1454139836959-1-8 on ExchangeId:
ID-FGBAL201530-50468-1454139836959-1-5). On delivery attempt: 0 caught:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x5dfa0735].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
08:47:17,187 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | START -
CRM_LoginRoute
08:47:17,187 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Sent Request
login to CRM:
{"platform":"base_IF-Customer_1454140037187","username":"admin","client_secret":"","grant_type":"password","client_id":"sugar","password":"admin"}
08:47:18,206 | WARN  | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
CONNECTION FAILED
ContentExchange@46d988db=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1019ms)->EXCEPTED(0ms)
java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.7.0_79]
	at
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)[:1.7.0_79]
	...
08:47:18,206 | WARN  | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Failed delivery
for (MessageId: ID-FGBAL201530-50468-1454139836959-1-10 on ExchangeId:
ID-FGBAL201530-50468-1454139836959-1-5). On delivery attempt: 1 caught:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x73a80633].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
08:48:18,215 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | START -
CRM_LoginRoute
08:48:18,215 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Sent Request
login to CRM:
{"platform":"base_IF-Customer_1454140098215","username":"admin","client_secret":"","grant_type":"password","client_id":"sugar","password":"admin"}
08:48:19,241 | WARN  | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
CONNECTION FAILED
ContentExchange@7f9f6d95=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1026ms)->EXCEPTED(0ms)
java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.7.0_79]
	at
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)[:1.7.0_79]
	...
	at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
08:48:19,241 | WARN  | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Failed delivery
for (MessageId: ID-FGBAL201530-50468-1454139836959-1-12 on ExchangeId:
ID-FGBAL201530-50468-1454139836959-1-5). *On delivery attempt: 1* caught:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x3bd392a8].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
08:49:19,257 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | START -
CRM_LoginRoute
08:49:19,257 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Sent Request
login to CRM:
{"platform":"base_IF-Customer_1454140159257","username":"admin","client_secret":"","grant_type":"password","client_id":"sugar","password":"admin"}
08:49:20,287 | WARN  | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
CONNECTION FAILED
ContentExchange@14bbe442=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1030ms)->EXCEPTED(0ms)
java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.7.0_79]
	at
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)[:1.7.0_79]
	...
08:49:20,287 | WARN  | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Failed delivery
for (MessageId: ID-FGBAL201530-50468-1454139836959-1-14 on ExchangeId:
ID-FGBAL201530-50468-1454139836959-1-5). On delivery attempt: 1 caught:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x3b86b3b0].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
08:50:20,305 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | START -
CRM_LoginRoute
08:50:20,305 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Sent Request
login to CRM:
{"platform":"base_IF-Customer_1454140220305","username":"admin","client_secret":"","grant_type":"password","client_id":"sugar","password":"admin"}
08:50:21,319 | WARN  | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
CONNECTION FAILED
ContentExchange@18cf8fcb=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1014ms)->EXCEPTED(0ms)
java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.7.0_79]
	at
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)[:1.7.0_79]
	...
08:50:21,319 | WARN  | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Failed delivery
for (MessageId: ID-FGBAL201530-50468-1454139836959-1-16 on ExchangeId:
ID-FGBAL201530-50468-1454139836959-1-5). *On delivery attempt: 1* caught:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x62e96526].
Caused by: [java.net.ConnectException - Connection refused: no further
information]

This is very strange... I use JBoss Fuse 6.2 based on Camel with version 
2.15.1.redhat-620133.

I'll try to do your example in JBoss Fuse and let you know.

Thanks for your support.

Greeting

Michele




--
View this message in context: http://camel.465427.n5.nabble.com/Error-Handling-and-Redelivery-Policy-between-routes-tp5776905p5777038.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Error Handling and Redelivery Policy between routes

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Thanks for the addition configuration and logs.

Are you getting a message history in the logs that identifies exactly where the failure occurs?

Without the message history, I’m guessing a little - but it appears the failure is in the CRM_LoginRoute on the inOut call to the jetty URI.

I put together a simple sample, and it seems to be working for me.  I stripped out all the external dependencies so I could focus on the logic.  When I run the test for this, with a good and a bad message, I can see the retry of the bad message (the sub-route gets called three times in this case.  So I can’t seem to reproduce the issue you’re having.

Here’s what I came up with - other than the external dependencies, can you see any differences?  I tested this against 2.15.5 and 2.16.2 (but the enrich DSL changes slightly for 2.16.2).

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <bean id="enrich-strategy" class="com.pronoia.camel.processor.aggregate.EnrichStrategy" />
    <bean id="sub-route-processor" class="com.pronoia.camel.processor.SubRouteProcessor"/>

    <camel:errorHandler id="no-error-handler" type="NoErrorHandler"/>

    <camel:errorHandler id="dlq-error-handler" type="DeadLetterChannel"
                        deadLetterUri="mock://failure">
        <camel:redeliveryPolicy
                maximumRedeliveries="3"
                redeliveryDelay="5000"
                allowRedeliveryWhileStopping="false"
                retryAttemptedLogLevel="WARN"
                />
    </camel:errorHandler>

    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route id="sub-route" errorHandlerRef="no-error-handler">
            <from uri="direct://sub-route"/>
            <log message="${routeId} - starting" />
                <process ref="sub-route-processor" />
                <log message="${routeId} - complete" />
        </route>

        <route id="main-route" errorHandlerRef="dlq-error-handler">

            <from uri="direct://source"/>
                <log message="${routeId} - starting" />

                <enrich uri="direct://sub-route" strategyRef="enrich-strategy" aggregateOnException="false"/>

                <log message="${routeId} complete" />
                <to uri="mock://complete" />
        </route>
    </camelContext>

</beans>




> On Jan 29, 2016, at 9:07 AM, Michele <mi...@finconsgroup.com> wrote:
> 
> CRMRedeliveryPolicy


Re: Error Handling and Redelivery Policy between routes

Posted by Michele <mi...@finconsgroup.com>.
Hi Stevenson,

first of all thanks a lot for your reply. ErrorHandler definitions:

<errorHandler id="NoErrorHandler" type="NoErrorHandler" />
<errorHandler id="DefaultErrorHandler" type="DefaultErrorHandler" />
		
		
		<errorHandler id="dlqErrorHandler" type="DeadLetterChannel"
			deadLetterUri="direct:failureTicketErrorHandler" >
			<redeliveryPolicy
maximumRedeliveries="{{amq.inbound.redeliverypolicy.maximum}}"
				redeliveryDelay="{{amq.inbound.redeliverypolicy.delay}}"
				allowRedeliveryWhileStopping="false" retryAttemptedLogLevel="WARN"
id="CRMRedeliveryPolicy"/>
		</errorHandler>


Logs simulating a ConnectException, 

First Attempt

16:54:26,116 | WARN  | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
CONNECTION FAILED
ContentExchange@5caa572a=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1010ms)->EXCEPTED(0ms)
java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.7.0_79]
	at
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)[:1.7.0_79]
	at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:117)[:1.7.0_79]
	at
org.eclipse.jetty.client.SelectConnector.startConnection(SelectConnector.java:79)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpDestination.startNewConnection(HttpDestination.java:292)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpDestination.doSend(HttpDestination.java:597)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:532)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpClient.send(HttpClient.java:180)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.apache.camel.component.jetty8.JettyContentExchange8.send(JettyContentExchange8.java:257)[239:org.apache.camel.camel-jetty8:2.15.1.redhat-620133]
	at
org.apache.camel.component.jetty.JettyHttpProducer.processInternal(JettyHttpProducer.java:233)[238:org.apache.camel.camel-jetty-common:2.15.1.redhat-620133]
	at
org.apache.camel.component.jetty.JettyHttpProducer.process(JettyHttpProducer.java:86)[238:org.apache.camel.camel-jetty-common:2.15.1.redhat-620133]
	at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.builder.NoErrorHandlerBuilder$1.process(NoErrorHandlerBuilder.java:40)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.Enricher.process(Enricher.java:142)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.RedeliveryErrorHandler$AsyncRedeliveryTask.call(RedeliveryErrorHandler.java:169)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.RedeliveryErrorHandler$AsyncRedeliveryTask.call(RedeliveryErrorHandler.java:116)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_79]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_79]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
	at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
16:54:26,116 | DEBUG | erRedeliveryTask | Pipeline                         |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Message exchange
has failed: so breaking out of pipeline for exchange:
Exchange[JmsMessage@0x17612b3b] Exception:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x17612b3b].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
16:54:26,116 | WARN  | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Failed delivery
for (MessageId: ID-FGBAL201530-64820-1454082785830-0-11 on ExchangeId:
ID-FGBAL201530-64820-1454082785830-0-5). On delivery attempt: 1 caught:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x17612b3b].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
16:54:26,116 | DEBUG | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Redelivery delay
calculated as 60000


Second Attempt

16:55:26,119 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | START -
CRM_LoginRoute
16:55:26,119 | DEBUG | erRedeliveryTask | CRMLoginProcessor                |
331 - CRT2-ESB-Commons - 0.0.1.SNAPSHOT | START - Prepare CRM Request Login
16:55:26,119 | DEBUG | erRedeliveryTask | CRMLoginProcessor                |
331 - CRT2-ESB-Commons - 0.0.1.SNAPSHOT | END - Prepare CRM Request Login
16:55:26,119 | INFO  | erRedeliveryTask | CRM_LoginRoute                   |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Sent Request
login to CRM:
{"platform":"base_IF-Customer_1454082926119","username":"admin","client_secret":"","grant_type":"password","client_id":"sugar","password":"admin"}
16:55:26,119 | DEBUG | erRedeliveryTask | SendProcessor                    |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | >>>>
Endpoint[http://127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token]
Exchange[JmsMessage@0x713093a5]
16:55:26,119 | DEBUG | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 | URI =
http://127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token
16:55:26,119 | DEBUG | erRedeliveryTask | JettyHttpProducer                |
238 - org.apache.camel.camel-jetty-common - 2.15.1.redhat-620133 | Sending
HTTP request to: http://127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token
16:55:26,119 | DEBUG | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
setStatus 1
ContentExchange@2c2d6fb1=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#START(0ms)->CONNECTING(0ms)
16:55:26,359 | DEBUG | ming/LOTTOMATICA | FileConsumer                     |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Took 0.000
seconds to poll: C:\CRT-2.0\IF-Customer\incoming\LOTTOMATICA
16:55:26,359 | DEBUG | mer/incoming/BNL | FileConsumer                     |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Took 0.000
seconds to poll: C:\CRT-2.0\IF-Customer\incoming\BNL
16:55:26,861 | DEBUG | mer/incoming/BNL | FileConsumer                     |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Took 0.000
seconds to poll: C:\CRT-2.0\IF-Customer\incoming\BNL
16:55:26,861 | DEBUG | ming/LOTTOMATICA | FileConsumer                     |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Took 0.000
seconds to poll: C:\CRT-2.0\IF-Customer\incoming\LOTTOMATICA
16:55:27,131 | DEBUG | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
setStatus 9
ContentExchange@2c2d6fb1=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1012ms)->EXCEPTED(0ms)
16:55:27,131 | WARN  | erRedeliveryTask | HttpExchange                     |
94 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 |
CONNECTION FAILED
ContentExchange@2c2d6fb1=POST//127.0.0.1:81/CRT_2_0/rest/v10/oauth2/token#CONNECTING(1012ms)->EXCEPTED(0ms)
java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[:1.7.0_79]
	at
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)[:1.7.0_79]
	at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:117)[:1.7.0_79]
	at
org.eclipse.jetty.client.SelectConnector.startConnection(SelectConnector.java:79)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpDestination.startNewConnection(HttpDestination.java:292)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpDestination.doSend(HttpDestination.java:597)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:532)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.eclipse.jetty.client.HttpClient.send(HttpClient.java:180)[94:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
	at
org.apache.camel.component.jetty8.JettyContentExchange8.send(JettyContentExchange8.java:257)[239:org.apache.camel.camel-jetty8:2.15.1.redhat-620133]
	at
org.apache.camel.component.jetty.JettyHttpProducer.processInternal(JettyHttpProducer.java:233)[238:org.apache.camel.camel-jetty-common:2.15.1.redhat-620133]
	at
org.apache.camel.component.jetty.JettyHttpProducer.process(JettyHttpProducer.java:86)[238:org.apache.camel.camel-jetty-common:2.15.1.redhat-620133]
	at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.builder.NoErrorHandlerBuilder$1.process(NoErrorHandlerBuilder.java:40)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.Enricher.process(Enricher.java:142)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.RedeliveryErrorHandler$AsyncRedeliveryTask.call(RedeliveryErrorHandler.java:169)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at
org.apache.camel.processor.RedeliveryErrorHandler$AsyncRedeliveryTask.call(RedeliveryErrorHandler.java:116)[198:org.apache.camel.camel-core:2.15.1.redhat-620133]
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_79]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_79]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
	at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
16:55:27,131 | DEBUG | erRedeliveryTask | Pipeline                         |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Message exchange
has failed: so breaking out of pipeline for exchange:
Exchange[JmsMessage@0x713093a5] Exception:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x713093a5].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
16:55:27,131 | WARN  | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Failed delivery
for (MessageId: ID-FGBAL201530-64820-1454082785830-0-13 on ExchangeId:
ID-FGBAL201530-64820-1454082785830-0-5). On delivery attempt: 1 caught:
org.apache.camel.CamelExchangeException: JettyClient failed cause by:
Connection refused: no further information. Exchange[JmsMessage@0x713093a5].
Caused by: [java.net.ConnectException - Connection refused: no further
information]
16:55:27,131 | DEBUG | erRedeliveryTask | DeadLetterChannel                |
198 - org.apache.camel.camel-core - 2.15.1.redhat-620133 | Redelivery delay
calculated as 60000


Thanks in advance

Best regards

Michele



--
View this message in context: http://camel.465427.n5.nabble.com/Error-Handling-and-Redelivery-Policy-between-routes-tp5776905p5776986.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Error Handling and Redelivery Policy between routes

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Can you share the configuration of the dlqErrorHandler, as well as a little more of the log - I’d like to see the exchange history.

Quinn Stevenson



> On Jan 28, 2016, at 4:28 AM, Michele <mi...@finconsgroup.com> wrote:
> 
> <route id="CRM_LoginRoute" errorHandlerRef="NoErrorHandler" >
> 			<from uri="direct:crm-login" />
> 				
> 				<process ref="CRMLoginProcessor" />
> 				<marshal ref="Gson" />
> 				<log message="Sent Request login to CRM: ${body}" loggingLevel="INFO"/>
> 				<inOut
> uri="jetty:{{crm.rs.host.name}}:{{crm.rs.port}}{{crm.rs.context.path}}/oauth2/token?throwExceptionOnFailure=true"
> />
> 				<log message="Received Response login from CRM: ${body}"
> loggingLevel="DEBUG"/>
> 				<unmarshal ref="Gson" />
> 				<log message="Authentication successful on CRM!" />
> 		</route>
> 
> 		
> 		<route id="ProcessingMessageData_Route" errorHandlerRef="dlqErrorHandler"
>> 
> 			<from uri="activemq:queue:IF_CUSTOMER_Inbound-NormalizedTickets" />
> 					
> 					<enrich uri="direct:crm-login" strategyRef="OAuthStrategy"
> aggregateOnException="false" />
> 
> 				
> 				<log message="Token ${in.header.OAuth-Token}" loggingLevel="DEBUG"/>
> 				<marshal ref="Gson" />
> 				<setHeader headerName="Content-Type">
> 					<constant>application/json</constant>
> 				</setHeader>
> 				<setHeader headerName="CamelHttpMethod">
> 					<constant>POST</constant>
> 				</setHeader>
> 				<log message="Request sent to CRM: ${body}" loggingLevel="INFO" />
> 				
> 				
> 				<setHeader headerName="CRMInsertTicketPath">
> 					<simple>
> 				
> jetty:{{crm.rs.host.name}}:{{crm.rs.port}}{{crm.rs.context.path}}/tk_rt_ticket/${in.header.customer-code}/insert?httpClient.idleTimeout=30000
> 					</simple>
> 				</setHeader>
> 				<log message="CRMInsertTicketPath:
> $simple{in.header.CRMInsertTicketPath}" />
> 				<recipientList stopOnException="true" parallelProcessing="false"
> streaming="false">
> 					<header>CRMInsertTicketPath</header>
> 					<to uri="activemq:queue:IF_CUSTOMER_Inbound-ProcessedTickets" />
> 				</recipientList>
> 		</route>