activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose María Zaragoza <demablo...@gmail.com>
Subject Re: Model thread question
Date Wed, 04 Sep 2013 21:58:22 GMT
But it doesn't have any sense for me.
If a Session has got a ThreadPoolExecutor to execute its tasks , I
think that Session can execute code in a parallel way ( between
different consumers)

 To sum up, my question is if it's possible to send messages to
different consumers during the same session ** concurrently **


Regards

2013/9/4 Christian Posta <christian.posta@gmail.com>:
> Yep, there would be a pool of threads for a session to use to dispatch to a
> consumer. But that's not the same thing as one thread per consumer. I
> believe the PDF doc to be incorrect in that regard.
>
>
> On Wed, Sep 4, 2013 at 2:44 PM, Jose María Zaragoza <demablogia@gmail.com>wrote:
>
>> OK. Thanks.
>>
>> But PDF doc talks about "one thread **per MessageConsumer**" , picked
>> from a pool of thread.
>> This is my question.
>>
>> The link that you attatched says "This basically means that session
>> will use its ThreadPoolExecutor to execute its tasks."
>> So, again, looks like there is a pool of thread to execute
>> MessageListener code per each MessageConsumer
>>
>>
>>
>>
>>
>>
>>
>> 2013/9/4 Christian Posta <christian.posta@gmail.com>:
>> > Double checked the source....... so here's the deal.. if you use
>> > dedicatedTaskRunner==true or
>> > -Dorg.apache.activemq.UseDedicatedTaskRunner=true, then you'll end up
>> with
>> > an executor at that session level with only one thread.
>> >
>> > Otherwise, the PDF docs are correct, you end up using a PooledTaskRunner
>> > which will allow up to 1000 threads in its pool (configurable).
>> >
>> > You can also check this doc as it explains it a little more:
>> >
>> http://activemq.apache.org/how-to-deal-with-large-number-of-threads-in-clients.html
>> >
>> > So to sum up, both are right. The flow is still one transport thread
>> > delivers to one (a single) session thread (unless you set
>> > alwaysSessionAsync, which removes the session threading and associated
>> > context switching altogether) which delivers to a consumer, however that
>> > "one session thread" is really a single thread in a possible pool of
>> > threads.
>> >
>> > Hope that helps out...
>> >
>> >
>> > On Wed, Sep 4, 2013 at 1:40 PM, Jose María Zaragoza <
>> demablogia@gmail.com>wrote:
>> >
>> >> Reading "ActiveMQ in action"  doesn't say anything about pool of
>> >> threads ( one per consumer )   :-S
>> >>
>> >> What a mess ...
>> >>
>> >>
>> >>
>> >> 2013/9/4 Jose María Zaragoza <demablogia@gmail.com>:
>> >> > Thanks.
>> >> >
>> >> > So , PDF is wrong , right ?
>> >> > what about pool of thread , i.e, one per MessageConsumer ? is it
>> false ?
>> >> > does internal queues exists ?
>> >> >
>> >> > I'm confuse , sorry
>> >> >
>> >> >
>> >> >
>> >> > 2013/9/4 Christian Posta <christian.posta@gmail.com>:
>> >> >> AFAIK...you have a logical thread for the transport that pulls
data
>> off
>> >> the
>> >> >> socket, and then a thread for each session. So a single session
can
>> have
>> >> >> multiple consumers, but a single session thread would dispatch
to the
>> >> >> consumers.
>> >> >>
>> >> >>
>> >> >> On Wed, Sep 4, 2013 at 11:17 AM, Jose María Zaragoza
>> >> >> <demablogia@gmail.com>wrote:
>> >> >>
>> >> >>> Hello:
>> >> >>>
>> >> >>> I'm using Apache ActiveMQ 5.8 and I've got a question about
thread
>> >> >>> model on consumer side
>> >> >>> I don't know either there is a thread pool per MessageConsumer
or
>> >> >>> there is a only one thread
>> >> >>>
>> >> >>>
>> >> >>> About this link
>> >> >>>
>> >> >>> http://activemq.apache.org/multiple-consumers-on-a-queue.html
>> >> >>>
>> >> >>> "The JMS contract is that only 1 session is used by one thread
at
>> once
>> >> >>> - which if you're using consumers means that only 1 consumer
can
>> >> >>> receive messages at once if using the same session. So if you
want
>> >> >>> concurrent consumption of messages, you need to use different
>> sessions
>> >> >>> for each consumer."
>> >> >>>
>> >> >>>
>> >> >>> But about this link
>> >> >>>
>> >> >>> http://fusesource.com/docs/esbent/7.0/amq_tuning/amq_tuning.pdf
>> >> >>>
>> >> >>> "The second thread layer consists of a pool of threads, where
each
>> >> >>> thread is associated with a javax.jms.MessageConsumer instance.
Each
>> >> >>> thread in this layer picks the
>> >> >>> relevant messages out of the session queue, inserting each
message
>> >> >>> into a queue inside the javax.jms.MessageConsumer instance."
>> >> >>>
>> >> >>>
>> >> >>> What is the true ?
>> >> >>>
>> >> >>> is there a thread pool per MessageConsumer ? or is there a
only one
>> >> thread
>> >> >>> ?
>> >> >>>
>> >> >>>
>> >> >>> Thanks and regards
>> >> >>>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> *Christian Posta*
>> >> >> http://www.christianposta.com/blog
>> >> >> twitter: @christianposta
>> >>
>> >
>> >
>> >
>> > --
>> > *Christian Posta*
>> > http://www.christianposta.com/blog
>> > twitter: @christianposta
>>
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta

Mime
View raw message