You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nader <na...@salas.dk> on 2017/02/24 12:41:56 UTC

Camel route does not reconnect

Hello

Our camel integrated-application gets messages from ActiveMQ and delivers it
to a consuming-application.

Because of network glitches, sometimes, the consuming-application is not
available for a while. Even the consuming-application is online  again, the
camel-integrated application fails to reconnect and resume the last message.

The camel version is 2.17.3

Is there anyway to force camel to reconnect or invalidate the session?

Thanks in advance.

The error look like this:

[Cannot write body: byte[] using session: (0x000001A0: nio socket, client,
0.0.0.0/0.0.0.0:53340 => null).
Exchange[ID-the-Host-34071-1487843214861-0-829]] [java.io.IOException:
Cannot write body: byte[] using session: (0x000001A0: nio socket, client,
0.0.0.0/0.0.0.0:53340 => null).
Exchange[ID-the-Host-34071-1487843214861-0-829]
	at
country.firm.integration.route.bean.RouteTemplate.send(RouteTemplate.java:69)
	at
country.firm.integration.route.bean.BaseDispatcherBean.sendToInOutEndpoint(BaseDispatcherBean.java:171)
	at
country.firm.integration.route.bean.DispatcherBean.sendMessageTcpOrHl7(DispatcherBean.java:452)
	...
	...
	...
Caused by: org.apache.camel.CamelExchangeException: 
      Cannot write body: byte[] using session: (0x000001A0: nio socket,
client, 0.0.0.0/0.0.0.0:53340 => null). 
	  Exchange[ID-the-Host-34071-1487843214861-0-829]
	at
org.apache.camel.component.mina2.Mina2Helper.writeBody(Mina2Helper.java:58)
	at
org.apache.camel.component.mina2.Mina2Producer.doProcess(Mina2Producer.java:166)
	at
org.apache.camel.component.mina2.Mina2Producer.process(Mina2Producer.java:116)
	...
	...
	...
2017-02-24 11:09:26,991] [INFO ] [Camel (camelContext-theApplication) thread
#0 - JmsConsumer[theQueue]] 
[org.apache.camel.processor.DefaultErrorHandler] Failed delivery for
(MessageId: ID:theRecieverHost-42190-1487661125797-23:1:-1:1:208 on 
ExchangeId: ID-the-Host-34071-1487843214861-0-829). Exhausted after delivery
attempt: 1 caught: 
country.firm.integration.ik.common.error.RollbackException: Original
exception:java.io.IOException, 
message:Cannot write body: byte[] using session: (0x000001A0: nio socket,
client, 0.0.0.0/0.0.0.0:53340 => null). 
Exchange[ID-the-Host-34071-1487843214861-0-829]. Processed by failure
processor: 
FatalFallbackErrorHandler[Pipeline[[Channel[DelegateSync[RollbackExceptionProcessor]],
Channel[DelegateSync[FinallyProcessor]]]]]

Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                       
Elapsed (ms)
[SenderApp         ] [SenderApp         ]
[mq://queue:theQueue?disableReplyTo=true                                      
] [     10236]
[SenderApp         ] [setHeader4        ] [setHeader[incomingEndpointName]                                              
] [         0]
[SenderApp         ] [to17              ] [direct:handleIncomingEndpoint                                                
] [     10236]
[direct:handleIncom] [to15              ]
[direct:setupIncomingEndpointHeadersAndProperties                             
] [         1]
[direct:setupIncomi] [doTry5            ] [doTry                                                                        
] [         1]
[direct:setupIncomi] [DispatcherBean.set]
[bean[country.firm.integration.route.bean.DispatcherBean@1eff0ddc]            
] [         0]
[direct:handleIncom] [doTry17           ] [doTry                                                                        
] [     10235]
[direct:handleIncom] [ik-common-route-in] [Processor@0x5595e0d0                                                         
] [         0]
[direct:handleIncom] [to16              ] [direct:sendMessageTransacted                                                 
] [     10235]
[direct:sendMessage] [transacted1       ]
[transacted[ref:PROPAGATION_REQUIRES_NEW]                                     
] [     10235]
[direct:sendMessage] [to5               ] [direct:sendMessageNonTransacted                                              
] [     10235]
[direct:sendMessage] [to6               ] [direct:sleepAfterRollback                                                    
] [         0]
[direct:sleepAfterR] [doTry9            ] [doTry                                                                        
] [         0]
[direct:sleepAfterR] [SleepAfterRollback] [Processor@0x51356a68                                                         
] [         0]
[direct:sendMessage] [choice1           ]
[when[{exchangeProperty{exchangeProperty(postProcessCamelFromEndPoint)} is
not ] [         0]
[direct:sendMessage] [doTry14           ] [doTry                                                                        
] [     10131]
[direct:sendMessage] [to8               ] [direct:sendMessage                                                           
] [     10131]
[direct:sendMessage] [doTry12           ] [doTry                                                                        
] [     10131]
[direct:sendMessage] [DispatcherBean.sen]
[bean[country.firm.integration.route.bean.DispatcherBean@1eff0ddc]            
] [     10080]
[direct:sendMessage] [to4               ] [direct:sendError                                                             
] [        20]
[direct:sendError  ] [doTry10           ] [doTry                                                                        
] [        20]
[direct:sendError  ] [DispatcherBean.sen]
[bean[country.firm.integration.route.bean.DispatcherBean@1eff0ddc]            
] [        20]
[direct:sendMessage] [ik-common-route-ch] [Processor@0x27c62e76                                                         
] [         7]
[direct:sendMessage] [ik-common-route-ch] [Processor@0x27c62e76                                                         
] [         0]
[                  ] [ik-common-route--O] [Processor@0x413156bf                                                         
] [        96]
[                  ] [ik-common-route--O] [Processor@0x3bd8ad29                                                         
] [         0]








--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by souciance <so...@gmail.com>.
I would say that is a activemq setting firstly.  In websphere mq the same
thing happens unless you define a backout queue for your input queue.
Alternatively must be a setting for setting number of times the message
should be rolled back..

Den 24 feb. 2017 5:07 em skrev "Nader [via Camel]" <
ml-node+s465427n5794445h58@n5.nabble.com>:

That's why I started this discussion .
If we don't restart the application then the error persist forever.

------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://camel.465427.n5.nabble.com/Camel-route-does-not-
reconnect-tp5794411p5794445.html
To start a new topic under Camel - Users (activemq), email
ml-node+s465427n465429h62@n5.nabble.com
To unsubscribe from Camel - Users, click here
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
.
NAML
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794449.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Nader <na...@salas.dk>.
That's why I started this discussion .
If we don't restart the application then the error persist forever.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794445.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by souciance <so...@gmail.com>.
Just a question, but why do you  need to restart the Camel application?
Even if you get time out the code should gracefully handle the error and
roll back or do something to indicate that an error occured but you
shouldn't have to restart it?

On Fri, Feb 24, 2017 at 4:32 PM, Nader [via Camel] <
ml-node+s465427n5794441h34@n5.nabble.com> wrote:

> Thanks a lot for your suggestion.
>
> The problem as I understand it is, there is a connection between sender
> and receivers parties, but its seems that camel acts on an old session.
>
> Another thing is: The "the out message was ...." get into the trace in few
> milliseconds.
>
> [2017-02-24 11:10:57,068] [INFO ]   -- before
> [2017-02-24 11:10:57,079] [ERROR] -- The OUT message was not received
> within : 30000 millis.
> [2017-02-24 11:10:57,082] [INFO ]   -- after
>
> I am not sure when camel starts to wait for a reply from the receiver.
>
> Secondly the message that has not been delivered is still in the Queue
> (ActiveMQ). So, after restart of application the very same message is sent
> out.
>
> Anyway, I will discuss your points with the developer.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-route-does-not-
> reconnect-tp5794411p5794441.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429h62@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794442.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Nader <na...@salas.dk>.
Thanks a lot for your suggestion.

The problem as I understand it is, there is a connection between sender and
receivers parties, but its seems that camel acts on an old session.

Another thing is: The "the out message was ...." get into the trace in few
milliseconds. 

[2017-02-24 11:10:57,068] [INFO ]   -- before
[2017-02-24 11:10:57,079] [ERROR] -- The OUT message was not received within
: 30000 millis. 
[2017-02-24 11:10:57,082] [INFO ]   -- after

I am not sure when camel starts to wait for a reply from the receiver.

Secondly the message that has not been delivered is still in the Queue
(ActiveMQ). So, after restart of application the very same message is sent
out.

Anyway, I will discuss your points with the developer.




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794441.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Nader <na...@salas.dk>.
I am aware of request/reply pattern, hence the disableReplyTo=true at
beginning of message history.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794447.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Claus Ibsen <cl...@gmail.com>.
That OUT message error is when you do request/reply over JMS (eg
InOut) then the reply message was not sent back to the JMSReplyTo
queue within those 30 seconds, and therefore Camel times out and
fails.

The JMS component has options to set higher timeout and much more

On Fri, Feb 24, 2017 at 3:48 PM, souciance
<so...@gmail.com> wrote:
> Well the thing is the statement here:
>
> [org.apache.camel.ExchangeTimedOutException: The OUT message was not
> received within:
>
> says that it got a time out issue and also at the end of the log there are
> statements that indicate the the route seems to use the mina component to
> send the data. But without looking at the code it is a bit hard to comment
> with details.
>
> But in general I would say when you are sending data then:
> 1. Either tell the developer to implement an error handler in the camel
> route so that the route retries until it receives a connection again.
> 2. Back out the message to a backout queue and manually retry after the
> connection is up. You would need to implement this as well and probably
> monitor that queue so you become aware of it.
> 3. The error seems to indicate that the rollback fails because no message
> was received within the 30 second time out value. Perhaps the developer can
> do a try/catch the exception and set the original message on the body if
> the route times out so the rollback can occur?
>
> But yeah without the code it is a bit hard to comment the details.
>
> On Fri, Feb 24, 2017 at 3:36 PM, Nader [via Camel] <
> ml-node+s465427n5794434h17@n5.nabble.com> wrote:
>
>> I am not developer, but am a MQ-administrator.
>>
>> If you have a specific question about the code (I hope regarding the
>> camel-route) then I will try to provide that to you, otherwise I have to
>> get a developer involved into this discussion.
>>
>> Doesn't the trace indicate that the session is not timing out? The
>> receiving application is closed.
>>
>> Is there anyway to set session time out for message delivery?
>>
>> Thanks in advance.
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://camel.465427.n5.nabble.com/Camel-route-does-not-
>> reconnect-tp5794411p5794434.html
>> To start a new topic under Camel - Users (activemq), email
>> ml-node+s465427n465429h62@n5.nabble.com
>> To unsubscribe from Camel - Users, click here
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
>> .
>> NAML
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794435.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel route does not reconnect

Posted by souciance <so...@gmail.com>.
Well the thing is the statement here:

[org.apache.camel.ExchangeTimedOutException: The OUT message was not
received within:

says that it got a time out issue and also at the end of the log there are
statements that indicate the the route seems to use the mina component to
send the data. But without looking at the code it is a bit hard to comment
with details.

But in general I would say when you are sending data then:
1. Either tell the developer to implement an error handler in the camel
route so that the route retries until it receives a connection again.
2. Back out the message to a backout queue and manually retry after the
connection is up. You would need to implement this as well and probably
monitor that queue so you become aware of it.
3. The error seems to indicate that the rollback fails because no message
was received within the 30 second time out value. Perhaps the developer can
do a try/catch the exception and set the original message on the body if
the route times out so the rollback can occur?

But yeah without the code it is a bit hard to comment the details.

On Fri, Feb 24, 2017 at 3:36 PM, Nader [via Camel] <
ml-node+s465427n5794434h17@n5.nabble.com> wrote:

> I am not developer, but am a MQ-administrator.
>
> If you have a specific question about the code (I hope regarding the
> camel-route) then I will try to provide that to you, otherwise I have to
> get a developer involved into this discussion.
>
> Doesn't the trace indicate that the session is not timing out? The
> receiving application is closed.
>
> Is there anyway to set session time out for message delivery?
>
> Thanks in advance.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-route-does-not-
> reconnect-tp5794411p5794434.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429h62@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794435.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Nader <na...@salas.dk>.
I am not developer, but am a MQ-administrator.

If you have a specific question about the code (I hope regarding the
camel-route) then I will try to provide that to you, otherwise I have to get
a developer involved into this discussion.

Doesn't the trace indicate that the session is not timing out? The receiving
application is closed.

Is there anyway to set session time out for message delivery?

Thanks in advance.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794434.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Nader <na...@salas.dk>.
Sure!

After these messages, the last message "The OUT message was not receive ..."
get repeated every 30 seconds.

Exchange[ID-the-Host-34071-1487843214861-0-829]
	at
country.firm.integration.route.processor.CheckExceptionProcessor.process(CheckExceptionProcessor.java:55)
	at
org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	...
	...
	...
[2017-02-24 11:09:27,000] [WARN ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[org.apache.camel.spring.spi.TransactionErrorHandler] Transaction rollback
(0x75ea7aa3) redelivered(false) for 
(MessageId: ID:theRecieverHost-42190-1487661125797-23:1:-1:1:208 on
ExchangeId: ID-the-Host-34071-1487843214861-0-829) 
caught: country.firm.integration.ik.common.error.RollbackException: Original
exception:java.io.IOException, message:
Cannot write body: byte[] using session: (0x000001A0: nio socket, client,
0.0.0.0/0.0.0.0:53340 => null). 
Exchange[ID-the-Host-34071-1487843214861-0-829]

[2017-02-24 11:09:27,000] [WARN ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[org.apache.camel.spring.spi.TransactionErrorHandler] Transaction rollback
(0x75ea7aa3) redelivered(false) for 
(MessageId: ID:theRecieverHost-42190-1487661125797-23:1:-1:1:208 on
ExchangeId: ID-the-Host-34071-1487843214861-0-829) 
caught: country.firm.integration.ik.common.error.RollbackException: Original
exception:java.io.IOException, message:
Cannot write body: byte[] using session: (0x000001A0: nio socket, client,
0.0.0.0/0.0.0.0:53340 => null). 
Exchange[ID-the-Host-34071-1487843214861-0-829]

[2017-02-24 11:09:27,000] [INFO ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[country.firm.integration.ik.common.processor.InitProcessor$CompletionLogger]
[theHost] 
[theApplication/direct://returnResponseFromIncomingEndpoint]
[country.firm.integration.ik.common.processor.InitProcessor$CompletionLogger:$Id: 
InitProcessor.java 33536 2015-06-16 08:41:21Z user1 $]
[Cb9df515-5a5c-431b-a077-874058119aa1] 
[SYSTEM] [End:requestId=[Cb9df515-5a5c-431b-a077-874058119aa1]
Succes=[false] externalTimeMs=[10079] timeMs=[10249]]
[2017-02-24 11:09:27,001] [WARN ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[org.apache.camel.component.jms.EndpointMessageListener] Execution of JMS
message listener failed. Caused by: 
[org.apache.camel.RuntimeCamelException -
country.firm.integration.ik.common.error.RollbackException: 
Original exception:java.io.IOException, message:
Cannot write body: byte[] using session: (0x000001A0: nio socket, client,
0.0.0.0/0.0.0.0:53340 => null). 
Exchange[ID-the-Host-34071-1487843214861-0-829]]
org.apache.camel.RuntimeCamelException:
country.firm.integration.ik.common.error.RollbackException: 
Original exception:java.io.IOException, message:Cannot write body: byte[]
using session: 
(0x000001A0: nio socket, client, 0.0.0.0/0.0.0.0:53340 => null).
Exchange[ID-the-Host-34071-1487843214861-0-829]
	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1690)
	at
org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:190)
	at
org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)
	at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	at
org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)
	at
org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)
	...
	...
	...

Caused by: country.firm.integration.ik.common.error.RollbackException:
Original exception:java.io.IOException, message:Cannot write body: byte[]
using session: (0x000001A0: nio socket, client, 0.0.0.0/0.0.0.0:53340 =>
null). Exchange[ID-the-Host-34071-1487843214861-0-829]
	at
country.firm.integration.route.processor.CheckExceptionProcessor.process(CheckExceptionProcessor.java:55)
	at
org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
	...
	...
	...
[2017-02-24 11:09:27,050] [INFO ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[AUDIT_LOGGER] [theHost]
[theApplication/direct://setupIncomingEndpointHeadersAndProperties] 
[country.firm.integration.ik.common.processor.InitProcessor:$Id:
InitProcessor.java 33536 2015-06-16 08:41:21Z user1 $] 
[f996381c-ee5d-4777-9c3c-b7f53dd4d862] [AUDIT]
[theApplication/direct://setupIncomingEndpointHeadersAndProperties] [null]
[null] 
[NORMAL] [] [] [Begin:requestId=[f996381c-ee5d-4777-9c3c-b7f53dd4d862]]

[2017-02-24 11:09:27,050] [WARN ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[country.firm.integration.route.bean.SleepAfterRollbackBean] [theHost]
[theApplication] 
[country.firm.integration.route.bean.SleepAfterRollbackBean:$Id:
SleepAfterRollbackBean.java 40647 2016-03-03 15:20:41Z user26 $] 
[null] [WARNING] [] [IncomingEndpoint: SenderApp sleeping 59950 ms before
handling the message] [] []

[2017-02-24 11:10:57,068] [INFO ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[country.firm.integration.route.bean.DispatcherBean] [theHost]
[theApplication/direct://sendMessage] 
[country.firm.integration.route.bean.DispatcherBean:$Id: DispatcherBean.java
46461 2016-08-25 12:22:51Z user2 $] 
[f996381c-ee5d-4777-9c3c-b7f53dd4d862] [EXECTIME] [CONSUMER] [] []
[tcp://SPCINC02.sp.local:
12313?sync=true&codec=#hl7codec&disconnect=true&cachedAddress=false] [30067]
[] [ID-the-Host-34071-1487843214861-0-835]
[2017-02-24 11:10:57,079] [ERROR] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[country.firm.integration.route.processor.ExceptionProcessor] [theHost]
[theApplication/direct://sendError] 
[country.firm.integration.route.processor.ExceptionProcessor:$Id:
ExceptionProcessor.java 43616 2016-05-13 09:27:33Z user26 $] 
[f996381c-ee5d-4777-9c3c-b7f53dd4d862] [ERROR]
[org.apache.camel.ExchangeTimedOutException] 
[The OUT message was not received within: 
30000 millis. Exchange[ID-the-Host-34071-1487843214861-0-835]] 
[org.apache.camel.ExchangeTimedOutException: The OUT message was not
received within: 
30000 millis. Exchange[ID-the-Host-34071-1487843214861-0-835]
	at
org.apache.camel.component.mina2.Mina2Producer.doProcess(Mina2Producer.java:173)
	at
org.apache.camel.component.mina2.Mina2Producer.process(Mina2Producer.java:116)
	at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
	...
	...
	...
[2017-02-24 11:10:57,082] [INFO ] [Camel (camelContext-theApplication)
thread #0 - JmsConsumer[theQueue]] 
[org.apache.camel.processor.DefaultErrorHandler] 
Failed delivery for (MessageId:
ID:theRecieverHost-42190-1487661125797-23:1:-1:1:208 on ExchangeId: 
ID-the-Host-34071-1487843214861-0-835). Exhausted after delivery attempt: 1
caught: 
country.firm.integration.ik.common.error.RollbackException: Original
exception:org.apache.camel.ExchangeTimedOutException, 
message:The OUT message was not received within: 30000 millis.
Exchange[ID-the-Host-34071-1487843214861-0-835]. 
Processed by failure processor:
FatalFallbackErrorHandler[Pipeline[[Channel[DelegateSync[RollbackExceptionProcessor]], 
Channel[DelegateSync[FinallyProcessor]]]]]
....
....



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794430.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by souciance <so...@gmail.com>.
Can you share your route or at the least the "camel" part?

On Fri, Feb 24, 2017 at 2:56 PM, Nader [via Camel] <
ml-node+s465427n5794427h0@n5.nabble.com> wrote:

> Thanks a lot for your quick answers.
>
> There are two facts that I didn't include in my request for keeping it as
> simple as possible.
>
> 1. If we restart the camel-integrated application, then every thing goes
> alright.
> The application retry to connect to the consuming-application and deliver
> correctly the last message.
>
> 2. Actually, later in the java error trace, camel DefaultErrorHandler
> tries to reconnect, but fails because of FatalFallbackErrorHandler.
>
> If you wish I can paste the rest of error trace in here.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-route-does-not-
> reconnect-tp5794411p5794427.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429h62@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794428.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Nader <na...@salas.dk>.
Thanks a lot for your quick answers.

There are two facts that I didn't include in my request for keeping it as
simple as possible.

1. If we restart the camel-integrated application, then every thing goes
alright.
The application retry to connect to the consuming-application and deliver
correctly the last message.

2. Actually, later in the java error trace, camel DefaultErrorHandler tries
to reconnect, but fails because of FatalFallbackErrorHandler.

If you wish I can paste the rest of error trace in here.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411p5794427.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel route does not reconnect

Posted by Claus Ibsen <cl...@gmail.com>.
Its more of an ActiveMQ questions as you need to setup it properly
(failover and reconnect settings, connection pooling etc).

And also in Camel you can use its error handler to retry (redeliver) a
message, so look at Camels error handler docs.

On Fri, Feb 24, 2017 at 1:41 PM, Nader <na...@salas.dk> wrote:
> Hello
>
> Our camel integrated-application gets messages from ActiveMQ and delivers it
> to a consuming-application.
>
> Because of network glitches, sometimes, the consuming-application is not
> available for a while. Even the consuming-application is online  again, the
> camel-integrated application fails to reconnect and resume the last message.
>
> The camel version is 2.17.3
>
> Is there anyway to force camel to reconnect or invalidate the session?
>
> Thanks in advance.
>
> The error look like this:
>
> [Cannot write body: byte[] using session: (0x000001A0: nio socket, client,
> 0.0.0.0/0.0.0.0:53340 => null).
> Exchange[ID-the-Host-34071-1487843214861-0-829]] [java.io.IOException:
> Cannot write body: byte[] using session: (0x000001A0: nio socket, client,
> 0.0.0.0/0.0.0.0:53340 => null).
> Exchange[ID-the-Host-34071-1487843214861-0-829]
>         at
> country.firm.integration.route.bean.RouteTemplate.send(RouteTemplate.java:69)
>         at
> country.firm.integration.route.bean.BaseDispatcherBean.sendToInOutEndpoint(BaseDispatcherBean.java:171)
>         at
> country.firm.integration.route.bean.DispatcherBean.sendMessageTcpOrHl7(DispatcherBean.java:452)
>         ...
>         ...
>         ...
> Caused by: org.apache.camel.CamelExchangeException:
>       Cannot write body: byte[] using session: (0x000001A0: nio socket,
> client, 0.0.0.0/0.0.0.0:53340 => null).
>           Exchange[ID-the-Host-34071-1487843214861-0-829]
>         at
> org.apache.camel.component.mina2.Mina2Helper.writeBody(Mina2Helper.java:58)
>         at
> org.apache.camel.component.mina2.Mina2Producer.doProcess(Mina2Producer.java:166)
>         at
> org.apache.camel.component.mina2.Mina2Producer.process(Mina2Producer.java:116)
>         ...
>         ...
>         ...
> 2017-02-24 11:09:26,991] [INFO ] [Camel (camelContext-theApplication) thread
> #0 - JmsConsumer[theQueue]]
> [org.apache.camel.processor.DefaultErrorHandler] Failed delivery for
> (MessageId: ID:theRecieverHost-42190-1487661125797-23:1:-1:1:208 on
> ExchangeId: ID-the-Host-34071-1487843214861-0-829). Exhausted after delivery
> attempt: 1 caught:
> country.firm.integration.ik.common.error.RollbackException: Original
> exception:java.io.IOException,
> message:Cannot write body: byte[] using session: (0x000001A0: nio socket,
> client, 0.0.0.0/0.0.0.0:53340 => null).
> Exchange[ID-the-Host-34071-1487843214861-0-829]. Processed by failure
> processor:
> FatalFallbackErrorHandler[Pipeline[[Channel[DelegateSync[RollbackExceptionProcessor]],
> Channel[DelegateSync[FinallyProcessor]]]]]
>
> Message History
> ---------------------------------------------------------------------------------------------------------------------------------------
> RouteId              ProcessorId          Processor
> Elapsed (ms)
> [SenderApp         ] [SenderApp         ]
> [mq://queue:theQueue?disableReplyTo=true
> ] [     10236]
> [SenderApp         ] [setHeader4        ] [setHeader[incomingEndpointName]
> ] [         0]
> [SenderApp         ] [to17              ] [direct:handleIncomingEndpoint
> ] [     10236]
> [direct:handleIncom] [to15              ]
> [direct:setupIncomingEndpointHeadersAndProperties
> ] [         1]
> [direct:setupIncomi] [doTry5            ] [doTry
> ] [         1]
> [direct:setupIncomi] [DispatcherBean.set]
> [bean[country.firm.integration.route.bean.DispatcherBean@1eff0ddc]
> ] [         0]
> [direct:handleIncom] [doTry17           ] [doTry
> ] [     10235]
> [direct:handleIncom] [ik-common-route-in] [Processor@0x5595e0d0
> ] [         0]
> [direct:handleIncom] [to16              ] [direct:sendMessageTransacted
> ] [     10235]
> [direct:sendMessage] [transacted1       ]
> [transacted[ref:PROPAGATION_REQUIRES_NEW]
> ] [     10235]
> [direct:sendMessage] [to5               ] [direct:sendMessageNonTransacted
> ] [     10235]
> [direct:sendMessage] [to6               ] [direct:sleepAfterRollback
> ] [         0]
> [direct:sleepAfterR] [doTry9            ] [doTry
> ] [         0]
> [direct:sleepAfterR] [SleepAfterRollback] [Processor@0x51356a68
> ] [         0]
> [direct:sendMessage] [choice1           ]
> [when[{exchangeProperty{exchangeProperty(postProcessCamelFromEndPoint)} is
> not ] [         0]
> [direct:sendMessage] [doTry14           ] [doTry
> ] [     10131]
> [direct:sendMessage] [to8               ] [direct:sendMessage
> ] [     10131]
> [direct:sendMessage] [doTry12           ] [doTry
> ] [     10131]
> [direct:sendMessage] [DispatcherBean.sen]
> [bean[country.firm.integration.route.bean.DispatcherBean@1eff0ddc]
> ] [     10080]
> [direct:sendMessage] [to4               ] [direct:sendError
> ] [        20]
> [direct:sendError  ] [doTry10           ] [doTry
> ] [        20]
> [direct:sendError  ] [DispatcherBean.sen]
> [bean[country.firm.integration.route.bean.DispatcherBean@1eff0ddc]
> ] [        20]
> [direct:sendMessage] [ik-common-route-ch] [Processor@0x27c62e76
> ] [         7]
> [direct:sendMessage] [ik-common-route-ch] [Processor@0x27c62e76
> ] [         0]
> [                  ] [ik-common-route--O] [Processor@0x413156bf
> ] [        96]
> [                  ] [ik-common-route--O] [Processor@0x3bd8ad29
> ] [         0]
>
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-route-does-not-reconnect-tp5794411.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2