2014/1/16 Ilya Kazakevich <[email protected]>:
> We have 2 ideas:
>
> * Use one Connection and one Session for the whole web-app, create consumer
> for each user and store it in user session. Each time user opens page we do
> receiveNoWait and obtain all messages she got.
>
> * Fetch all messages from all consumers on background thread and store them
> in collection, so each request would get them.
>
> I like the first one, but I am not sure accessing one Session from different
> threads is good idea.
> What do you think?

A Connection is thread safe, but Sessions, MessageProducers, and
MessageConsumers are not. The recommended strategy is to use one
Session per application thread.

Reply via email to