camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raul Kripalani (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-6123) camel-jms: InOut exchange can time out even if response was received
Date Fri, 22 Mar 2013 00:13:15 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-6123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Raul Kripalani updated CAMEL-6123:
----------------------------------

    Description: 
When performing an InOut JMS exchange with a certain requestTimeout, if the reply message
is received in time, but the following formula stands true: 

{{T0 + T1 >= T!}}, where:

T0 = JMS response time
T1 = remaining route processing time following the reply
T! = requestTimeout

Then camel-jms will throw an {{ExchangeTimedOutException}} regardless of the fact that the
reply was truly received in time.

I'm surprised this bug has gone unnoticed until now, as it's been present since mid-2010.

*Example unit test:*

{code:java}
    @Test
    public void testTimeoutNotTriggered() throws Exception {
        getMockEndpoint("mock:exception").expectedMessageCount(0);
        template.requestBody("activemq:test", "<hello />");
        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {

                onException(ExchangeTimedOutException.class)
                    .handled(true)
                    .to("mock:exception");

                from("activemq:test")
                    .inOut("activemq:test?requestTimeout=500")
                    .delay(constant(1000));
                
                from("activemq:test")
                    .log("test");
            }
        };
    }
{code}

  was:
When performing an InOut JMS exchange with a certain requestTimeout, if the reply message
is received in time, but the following formula stands true: 

{{T0 + T1 >= T!}}, where:

T0 = JMS response time
T1 = remaining route processing time following the reply
T! = requestTimeout

Then camel-jms will throw an {{ExchangeTimedOutException}} regardless of the fact that the
reply was truly received in time.

I'm surprised this bug has gone unnoticed until now, as it's been present since mid-2010.

*Example unit test:*

{code:java}
    @Test
    public void testTimeoutNotTriggered() throws Exception {
        getMockEndpoint("mock:exception").expectedMessageCount(0);
        template.requestBody("activemq:test", "<hello />");
        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {

                onException(ExchangeTimedOutException.class)
                    .handled(true)
                    .to("mock:exception");

                from("activemq:test")
                    .to("activemq:inexistent?requestTimeout=500")
                    .delay(constant(600));
            }
        };
    }
{code}

    
> camel-jms: InOut exchange can time out even if response was received
> --------------------------------------------------------------------
>
>                 Key: CAMEL-6123
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6123
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.9.5, 2.10.3
>            Reporter: Raul Kripalani
>            Assignee: Raul Kripalani
>            Priority: Critical
>             Fix For: 2.9.6, 2.10.5, 2.11.0
>
>
> When performing an InOut JMS exchange with a certain requestTimeout, if the reply message
is received in time, but the following formula stands true: 
> {{T0 + T1 >= T!}}, where:
> T0 = JMS response time
> T1 = remaining route processing time following the reply
> T! = requestTimeout
> Then camel-jms will throw an {{ExchangeTimedOutException}} regardless of the fact that
the reply was truly received in time.
> I'm surprised this bug has gone unnoticed until now, as it's been present since mid-2010.
> *Example unit test:*
> {code:java}
>     @Test
>     public void testTimeoutNotTriggered() throws Exception {
>         getMockEndpoint("mock:exception").expectedMessageCount(0);
>         template.requestBody("activemq:test", "<hello />");
>         assertMockEndpointsSatisfied();
>     }
>     @Override
>     protected RouteBuilder createRouteBuilder() throws Exception {
>         return new RouteBuilder() {
>             @Override
>             public void configure() throws Exception {
>                 onException(ExchangeTimedOutException.class)
>                     .handled(true)
>                     .to("mock:exception");
>                 from("activemq:test")
>                     .inOut("activemq:test?requestTimeout=500")
>                     .delay(constant(1000));
>                 
>                 from("activemq:test")
>                     .log("test");
>             }
>         };
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message