You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Markus Joschko <ma...@gmail.com> on 2006/08/23 18:14:33 UTC

AJAX demo and session pooling

Hi all,
I had a look at the ajax demo and find it quite interesting. I'm just
wondering about the best approach to implement pooling (as the ajax demo is
creating a new session & connection for each consumer and not getting them
from a pool). 

I'm quite lost while looking through all provided utility projects that
could be used for pooling. ActiveMQ has a pooledConnectionFactory, Spring
has something and of course there is Jencks. Can anybody shed some light
which would be the best choice for the web scenario which I would define as:
A user enters the webpage subscribes to a topic (the topics are not known on
configuration time but are created dynamically during the application run),
keeps the http session open for consuming the messages, sends a message from
time to time and leaves the page after a while -> typicall chat application.
Is pooling overhead in this scenario as the connection and session is kept? 

Thanks,
 Markus



-- 
View this message in context: http://www.nabble.com/AJAX-demo-and-session-pooling-tf2153326.html#a5947649
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AJAX demo and session pooling

Posted by Markus Joschko <ma...@gmail.com>.
James, thanks for replying.
I'll revisit the code with my updated knowledge ;-)
-- 
View this message in context: http://www.nabble.com/AJAX-demo-and-session-pooling-tf2153326.html#a5959217
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AJAX demo and session pooling

Posted by James Strachan <ja...@gmail.com>.
On 8/23/06, Markus Joschko <ma...@gmail.com> wrote:
>
> That means that the creation of a connection for the vm transport is so
> efficient that pooling is not required?

Yes - plus you can't pool consumers without using them. Consumers are
not like JDBC connections which if you don't use them they have no
effect on the system, since consumers start to consume messages.


> Why is it necessary to create a new connection for each new session?

Its not - only a JMS session/consumer is required. One connection for
the entire JVM is fine.

So to summarise; 1 JMS connection for the JVM, each HTTP session has
its own JMS session and producer/consumer.
-- 

James
-------
http://radio.weblogs.com/0112098/

Re: AJAX demo and session pooling

Posted by Markus Joschko <ma...@gmail.com>.
That means that the creation of a connection for the vm transport is so
efficient that pooling is not required? 

Why is it necessary to create a new connection for each new session? Can't
the connection be pulled from a pool when the user opens the HttpSessionand
returned if he leaves? Sorry I'm very new to JMS/ActiveMQ and try to
understand as much as possible to use it as effective as possible.

Thanks for reply,
 Markus
-- 
View this message in context: http://www.nabble.com/AJAX-demo-and-session-pooling-tf2153326.html#a5948410
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AJAX demo and session pooling

Posted by James Strachan <ja...@gmail.com>.
On 8/23/06, Markus Joschko <ma...@gmail.com> wrote:
>
> Hi all,
> I had a look at the ajax demo and find it quite interesting. I'm just
> wondering about the best approach to implement pooling (as the ajax demo is
> creating a new session & connection for each consumer and not getting them
> from a pool).

It needs to create a new connection & consumer for each new session.
You can't really pool consumers (in the way you'd pool producers or
JDBC connections etc)

To limit chattiness, you could deploy an ActiveMQ broker inside the
web application (and if need be network this broker to other brokers)

-- 

James
-------
http://radio.weblogs.com/0112098/