Results 1 to 4 of 4

Thread: spring - rabbitmq when are channels closed

  1. #1
    Join Date
    Jan 2013
    Posts
    3

    Default spring - rabbitmq when are channels closed

    Hi all,

    I am trying to find out when Spring will close a channel it has opened to RabbitMQ.

    Thanks,
    Frank

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    The CachingConnectionFactory caches the connection and (by default) 1 channel; the number of cached channels can be configured but you cannot set it to less than 1. Channels in excess of the cache size are closed when returned to the cache.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Jan 2013
    Posts
    3

    Default

    Hi Gary,

    When using the CachingConnectionFactory and opening many channels that are only needed for a very short period of time is there a way to close the channels explicitly?

    Thanks again,
    Frank

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    If you use the default settings, only one channel will remain open, all the others will be closed when they are returned to the cache. No, you can't close the channel explicitly (although you could dig into the proxy and close the target Channel, but I wouldn't recommend that).
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •