[rabbitmq-discuss] Securing RabbitMQ

Steve Powell steve at rabbitmq.com
Mon Feb 13 15:57:49 GMT 2012

Sorry not to get back to you sooner.

Ok, so these threads are used by *your* Consumers. In which case they probably
have no relation to the threads which we manage (to allow multiple channels to
use a pool of threads to execute consumer callbacks).

We create our pool of threads using ExecutorServices (in
java.util.concurrent.ExecutorService) with the call
Executors.newFixedThreadPool(NUM_THREADS). This produces an ExecutorService with
a fixed number of threads.

If you create a connection with newConnection(executorService), you can pass in
your own ExecutorService (of which there are many in java.util.concurrent -- or
you can roll your own) and some of these may have a dynamically varying number
of threads -- I don't know. However, it is entirely up to you.

Be careful, though, this is a notoriously difficult area of design -- better to
use a pre-designed one than try to implement one of your own.

Does this answer your question? I'm not at all sure what pool of threads you
want to 'dynamically vary'.

Steve Powell  (a happy bunny)
----------some more definitions from the SPD----------
vermin (v.) Treating the dachshund for roundworm.
chinchilla (n.) Cooling device for the lower jaw.
socialcast (n.) Someone to whom everyone is speaking but nobody likes.

On 2 Feb 2012, at 18:19, Bell, Paul M. wrote:

> Sorry, Steve - my error. The "Consumer" class I referenced is mine. Its constructor takes the aforementioned "3" and presents it to a setConcurrentConsumers call, something like the following:
>             SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
>                container.setConcurrentConsumers(numConsumerThreads);
> So I guess I am asking about dynamically adjusting the number of these threads.
> Thanks.
> -Paul
> -----Original Message-----
> From: Steve Powell [mailto:steve at rabbitmq.com]
> Sent: Thursday, February 02, 2012 11:58 AM
> To: Bell, Paul M.
> Cc: RabbitMQ List
> Subject: Re: [rabbitmq-discuss] Securing RabbitMQ
> Paul,
> Sorry, Paul, but I don't understand the question.
> To what Consumer are you referring? It is not possible
> to instantiate a java interface class (which Consumer is).
> Perhaps you are using another client?
> The Java Client's threading policy for Consumer callbacks
> changed in 2.7.0. You might like to read the blog entry(1) and
> the notes in the Java Client API pages(2).
> Cheers,
> Steve Powell
> steve at rabbitmq.com
> [wrk: +44-2380-111-528] [mob: +44-7815-838-558]
> (1) http://www.rabbitmq.com/blog/2011/12/20/rabbitmq-2-7-0-and-2-7-1-are-released/
> (2) http://www.rabbitmq.com/api-guide.html ('Channel thread-safety' and 'Advanced connection options')
> On 1 Feb 2012, at 19:57, Bell, Paul M. wrote:
>> My question: is it possible to adjust the "concurrency" of a consumer in real time? That is, when I create a consumer with
>>    Consumer consumer = new Consumer("q1", "q1", 3);
>> I get a single consumer that runs 3 threads. Can I adjust this "3" dynamically?
>> Thanks again.
>> -Paul
> ATTENTION: -----
> The information contained in this message (including any files transmitted with this message) may contain proprietary, trade secret or other  confidential and/or legally privileged information. Any pricing information contained in this message or in any files transmitted with this message is always confidential and cannot be shared with any third parties without prior written approval from Syncsort. This message is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any use, disclosure, copying or distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and/or Syncsort and destroy all copies of this message in your possession, custody or control.

More information about the rabbitmq-discuss mailing list