Hello Claus,

I am still having some problems. Whilst the connection is re-established, I
believe the ChannelFuture never indicates that the send completes. I believe
this is happening because:

(1) Only one message after establishing the connection again appears to
start processing.

(2) When I try to shutdown my executable (kill <pid>) I see the following:

2010-05-09 21:42:13,529::DEBUG: 1 inflight and pending exchanges for
consumer: Consumer[activemq://xxx.yyy]
2010-05-09 21:42:13,530::INFO : Waiting as there are still 1 inflight and
pending exchanges to complete before we can shutdown
2010-05-09 21:42:14,533::DEBUG: 1 inflight and pending exchanges for
consumer: Consumer[activemq://xxx.yyy]
2010-05-09 21:42:14,533::INFO : Waiting as there are still 1 inflight and
pending exchanges to complete before we can shutdown
2010-05-09 21:42:15,537::DEBUG: 1 inflight and pending exchanges for
consumer: Consumer[activemq://xxx.yyy]
2010-05-09 21:42:15,538::INFO : Waiting as there are still 1 inflight and
pending exchanges to complete before we can shutdown
2010-05-09 21:42:16,541::DEBUG: 1 inflight and pending exchanges for
consumer: Consumer[activemq://xxx.yyy]
2010-05-09 21:42:16,541::INFO : Waiting as there are still 1 inflight and
pending exchanges to complete before we can shutdown

I will play with the camel netty component tomorrow (Monday) and see if I
can find out why this is occurring.

thanks again,
Gareth


Claus Ibsen-2 wrote:
> 
> Hi
> 
> I have committed fixes to camel-netty today.
> 
> Can you test it on your system. It should now support re-connection
> and proper shutdown and whatnot.
> 
> Mind that I have aligned and added the options so it matches the one
> we got in camel-mina.
> eg sync is now default true etc.
> 
> Updated wiki page
> https://cwiki.apache.org/confluence/display/CAMEL/Netty
> 
> 
> On Thu, May 6, 2010 at 11:19 AM, Claus Ibsen <claus.ib...@gmail.com>
> wrote:
>> Hi
>>
>> I created a couple of tickets to improve/fix camel-netty
>> https://issues.apache.org/activemq/browse/CAMEL-2698
>> https://issues.apache.org/activemq/browse/CAMEL-2699
>>
>> I got the first one committed, and will work on the 2nd ticket.
>>
>>
>> On Thu, May 6, 2010 at 6:33 AM, Claus Ibsen <claus.ib...@gmail.com>
>> wrote:
>>> Hi
>>>
>>> Well spotted. Can you create a JIRA ticket ticket for that.
>>>
>>>
>>> On Thu, May 6, 2010 at 6:29 AM, Gareth Collins
>>> <gareth_coll...@hotmail.com> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I took a look at the Netty Producer code:
>>>>
>>>>    public void process(Exchange exchange) throws Exception {
>>>>        if (configuration.isSync()) {
>>>>            countdownLatch = new CountDownLatch(1);
>>>>        }
>>>>
>>>>        Channel channel = channelFuture.getChannel();
>>>>        channel.write(exchange.getIn().getBody());
>>>>
>>>>        if (configuration.isSync()) {
>>>>            boolean success =
>>>> countdownLatch.await(configuration.getReceiveTimeoutMillis(),
>>>> TimeUnit.MILLISECONDS);
>>>>            if (!success) {
>>>>                throw new ExchangeTimedOutException(exchange,
>>>> configuration.getReceiveTimeoutMillis());
>>>>            }
>>>>            Object response = ((ClientChannelHandler)
>>>> clientPipeline.get("handler")).getResponse();
>>>>            exchange.getOut().setBody(response);
>>>>        }
>>>>    }
>>>>
>>>> After taking a look at the netty documentation, I don't see how this
>>>> will
>>>> detect write failures (as I understand the channel.write() is
>>>> asynchronous).
>>>> Don't we need to wait on the ChannelFuture returned from the
>>>> channel.write()? (i.e.
>>>>
>>>> Channel channel = channelFuture.getChannel();
>>>> ChannelFuture channelWriteFuture =
>>>> channel.write(exchange.getIn().getBody());
>>>> channelWriteFuture.awaitUninterruptibly()
>>>> if (channelWriteFuture.isSuccess() == false)
>>>> {
>>>>    // throw some exception
>>>>    // or possibly if connection closed, try to create connection and
>>>> send
>>>> again
>>>>    // if fails again throw exception
>>>> }
>>>>
>>>> thanks in advance,
>>>> Gareth Collins
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Recovery-From-Netty-Connection-Drop-tp28467631p28469185.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Recovery-From-Netty-Connection-Drop-tp28467631p28507206.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to