You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Krzysztof Jamróz (Jira)" <ji...@apache.org> on 2021/02/10 15:54:00 UTC
[jira] [Created] (CAMEL-16178) Enrich with REST+netty hangs when
connection is closed without response
Krzysztof Jamróz created CAMEL-16178:
----------------------------------------
Summary: Enrich with REST+netty hangs when connection is closed without response
Key: CAMEL-16178
URL: https://issues.apache.org/jira/browse/CAMEL-16178
Project: Camel
Issue Type: Bug
Affects Versions: 3.7.2, 3.4.5
Reporter: Krzysztof Jamróz
Attachments: EnrichWithoutRestResponseTest.java
Enricher hangs when used with REST endpoint utilizing netty when there is no response from the server but the server immediately closes the connection. In such case read timeout is ignored as connection is already closed.
The reason of this behavior is that {{org.apache.camel.component.netty.handlers.ClientChannelHandler.channelInactive}} contains following conditions for callback invocation when there was no response:
{code:java}
configuration.isSync() && !doneUoW && !messageReceived && !exceptionHandled
{code}
where
{code:java}
doneUoW = exchange.getUnitOfWork() == null
{code}
It works as expected when initially there had been UoW in Exchange (this is the case when using {{to}}). However, enricher by default (and by design) clears UoW for exchange it creates and this breaks above check.
Setting {{shareUnitOfWork}} for {{enrich}} works around the problem.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)