Closing a Tcp Transport Connector

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Closing a Tcp Transport Connector

Musu
This post was updated on .
Hi all,

It's been couple of days that I've been trying to figure it out what's going wrong with my application.

I am using activemq 5.9.1 libraries

I have a consumer client that uses an embedded broker that is using a tcp transport connector and a remote producer that is constantly publishing a single message on several queues sequentially.

Generally a smooth shutdown process would be:
shutdown the remote to stop sending messages

connection.close();
session.close();
consumer.close()

Yet I would like to be able to simply close the connection between the remote producer and the consumer keeping both of them alive, hence I simply do a broker.removeConnection(transportConnector).

In an example I set up, the consumer is not consuming the messages, so all of the received messages remain in the queue.

But right after closing the transport connector and querying the queue sizes I see a disparity in their sizes since one queue seems to be missing messages, all the others are all consistent.

I assume that closing the transport connector is a bit unconventional, but I can't seem to find another way to stop the broker from receiving messages and let the consumers keep working.

Thanks for your help
Reply | Threaded
Open this post in threaded view
|

Re: Closing a Tcp Transport Connector

ceposta
Can you post a test to reproduce?


On Fri, May 23, 2014 at 6:37 AM, Musu <[hidden email]> wrote:

> Hi all,
>
> It's been couple of days that I've been trying to figure it out what's
> going
> wrong with my application.
>
> I have a consumer client that uses an embedded broker that is using a tcp
> transport connector and a remote producer that is constantly publishing a
> single message on several queues sequentially.
>
> Generally a smooth shutdown process would be:
> shutdown the remote to stop sending messages
>
> connection.close();
> session.close();
> consumer.close()
>
> Yet I would like to be able to simply close the connection between the
> remote producer and the consumer keeping both of them alive, hence I simply
> do a broker.removeConnection(transportConnector).
>
> In an example I set up, the consumer is not consuming the messages, so all
> of the received messages remain in the queue.
>
> But right after closing the transport connector and querying the queue
> sizes
> I see a disparity in their sizes since one queue seems to be missing
> messages, all the others are all consistent.
>
> I assume that closing the transport connector is a bit unconventional, but
> I
> can't seem to find another way to stop the broker from receiving messages
> and let the consumers keep working.
>
> Thanks for your help
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Closing-a-Tcp-Transport-Connector-tp4681357.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta
Reply | Threaded
Open this post in threaded view
|

Re: Closing a Tcp Transport Connector

Musu
Hi Ceposta,

I'll try to have a test case set up for you. Thanks for your help

Enrico