How close all open connections/channels

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

How close all open connections/channels

cw storm
Today, I have open connections/channels for consumers link to the queues.  I'm manually closing the connections/channels via the RabbitMQ console.  I would like to make this easier for our support folks so they don't have to do this for each of the queues.  Just checking the community if anyone has coded this on the client side to close the connections/channels for each of the queue consumers.

_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How close all open connections/channels

cw storm
I suppose I could loop through each of the queue and issue "channel.basicCancel" since I know the consumerTag.


On Tue, Jun 24, 2014 at 2:51 PM, cw storm <[hidden email]> wrote:
Today, I have open connections/channels for consumers link to the queues.  I'm manually closing the connections/channels via the RabbitMQ console.  I would like to make this easier for our support folks so they don't have to do this for each of the queues.  Just checking the community if anyone has coded this on the client side to close the connections/channels for each of the queue consumers.


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How close all open connections/channels

Michael Klishin-2
In reply to this post by cw storm
On 24 June 2014 at 22:53:18, cw storm ([hidden email]) wrote:
> > Today, I have open connections/channels for consumers link  
> to the queues. I'm manually closing the connections/channels  
> via the RabbitMQ console. I would like to make this easier for  
> our support folks so they don't have to do this for each of the queues.  
> Just checking the community if anyone has coded this on the client  
> side to close the connections/channels for each of the queue  
> consumers.

You can both list connections via HTTP API and close them. This is what
some client test suites do to test connection recovery:

https://github.com/ruby-amqp/bunny/blob/master/spec/higher_level_api/integration/connection_recovery_spec.rb#L9-13
https://github.com/michaelklishin/langohr/blob/master/test/langohr/test/recovery_test.clj#L39-41

See HTTP API docs for more info. 
--  
MK  

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How close all open connections/channels

Michael Klishin-2
 On 25 June 2014 at 07:37:06, Michael Klishin ([hidden email]) wrote:
> > You can both list connections via HTTP API and close them.

…as well as rabbitmqctl, of course.
--  
MK  

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How close all open connections/channels

cw storm
I was hoping to use "channel.basicCancel" but that's not going to work since I'm establishing a new conn/channel.

So, I guess I have to fully rely on the HTTP API method in order to easily close all connections that I'm interested in?  The goal is to provide operation support to easily close all connections/channels for a mask of consumers.  Today, he/she uses the rabbitmq console to force the close connection.


On Tue, Jun 24, 2014 at 11:46 PM, Michael Klishin <[hidden email]> wrote:
 On 25 June 2014 at 07:37:06, Michael Klishin ([hidden email]) wrote:
> > You can both list connections via HTTP API and close them.

…as well as rabbitmqctl, of course.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How close all open connections/channels

cw storm
I'm considering of using rabbitmqctl to close connections based on certain consumerTags.  Is this possible?


On Wed, Jun 25, 2014 at 3:25 PM, cw storm <[hidden email]> wrote:
I was hoping to use "channel.basicCancel" but that's not going to work since I'm establishing a new conn/channel.

So, I guess I have to fully rely on the HTTP API method in order to easily close all connections that I'm interested in?  The goal is to provide operation support to easily close all connections/channels for a mask of consumers.  Today, he/she uses the rabbitmq console to force the close connection.


On Tue, Jun 24, 2014 at 11:46 PM, Michael Klishin <[hidden email]> wrote:
 On 25 June 2014 at 07:37:06, Michael Klishin ([hidden email]) wrote:
> > You can both list connections via HTTP API and close them.

…as well as rabbitmqctl, of course.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ



_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: How close all open connections/channels

Michael Klishin-2
In reply to this post by cw storm
On 25 June 2014 at 23:27:17, cw storm ([hidden email]) wrote:
> > I was hoping to use "channel.basicCancel" but that's not going
> to work since I'm establishing a new conn/channel.

Sorry, why do you expect basic.cancel to close connections? It cancels
consumers (terminates subscriptions, if you will) and does not affect
connections in any way.

> So, I guess I have to fully rely on the HTTP API method in order to
> easily close all connections that I'm interested in? The goal
> is to provide operation support to easily close all connections/channels
> for a mask of consumers. Today, he/she uses the rabbitmq console
> to force the close connection.

HTTP API was created for the cases like yours. rabbitmqctl can work just as well
but I find parsing standard output to be a more fragile solution than parsing a JSON response.

By the way, RabbitMQ mailing list has a new home:
https://groups.google.com/group/rabbitmq-users

Please post your future questions and bug reports there :)
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss