You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jose María Zaragoza <de...@gmail.com> on 2013/07/03 21:11:00 UTC
jmsTemplate + add listener to listener container
Hello:
I'm newbie with Apache ActiveMQ and
I've started using 5.8.0 release + Spring
I want that every session created in a servlet container ( Tomcat ),
subscribes itself as consumer/listener for message from a Topic ( created
into JMS broker by an admin )
I've got some questions:
If I've got a listener container as
<jms:listener-container concurrency="10" >
<jms:listener id="QueueListener" destination="Queue.Name"
ref="queueListener" />
</jms:listener-container>
</beans>
1)
Can I add <jms:listener> ( a.k.a MessageListener ) to Listener Container on
runtime ?
I want to add one listener per web session
How ?
2)
If I can't,
Can I create a Consumer on runtime and set a MessageListener for it by
using jmsTemplate?
I tried to do it with JMS API in jmsTemplate.execute() with
SessionCallback,
And a Consumer is created but MessageListener never is called and message
is never consumed from Topic.
Why ? How ?
3)
If I can't ,
If I use PooledConnectionFactory + JMS API ( no listener-container )
do I need to close Connection objects and release Consumers/Producers by
hand ?
Remember I want to create a Consumer per session
4)
Is there other way to do all these things on an easy mode ?
Thanks and regards
Re: jmsTemplate + add listener to listener container
Posted by Jose María Zaragoza <de...@gmail.com>.
You're right.
I hoped an answer based on experience of ActiveMQ users
2013/7/3 Christian Posta <ch...@gmail.com>
> Those might be good questions to ask in the Spring forum?
>
>
> On Wed, Jul 3, 2013 at 3:11 PM, Jose María Zaragoza <demablogia@gmail.com
> >wrote:
>
> > Hello:
> >
> > I'm newbie with Apache ActiveMQ and
> > I've started using 5.8.0 release + Spring
> >
> >
> > I want that every session created in a servlet container ( Tomcat ),
> > subscribes itself as consumer/listener for message from a Topic (
> created
> > into JMS broker by an admin )
> >
> > I've got some questions:
> >
> > If I've got a listener container as
> >
> > <jms:listener-container concurrency="10" >
> > <jms:listener id="QueueListener" destination="Queue.Name"
> > ref="queueListener" />
> > </jms:listener-container>
> > </beans>
> >
> > 1)
> >
> > Can I add <jms:listener> ( a.k.a MessageListener ) to Listener Container
> on
> > runtime ?
> > I want to add one listener per web session
> > How ?
> >
> > 2)
> >
> > If I can't,
> >
> > Can I create a Consumer on runtime and set a MessageListener for it by
> > using jmsTemplate?
> > I tried to do it with JMS API in jmsTemplate.execute() with
> > SessionCallback,
> > And a Consumer is created but MessageListener never is called and message
> > is never consumed from Topic.
> >
> > Why ? How ?
> >
> >
> > 3)
> >
> > If I can't ,
> >
> > If I use PooledConnectionFactory + JMS API ( no listener-container )
> > do I need to close Connection objects and release Consumers/Producers by
> > hand ?
> >
> > Remember I want to create a Consumer per session
> >
> >
> > 4)
> >
> > Is there other way to do all these things on an easy mode ?
> >
> >
> > Thanks and regards
> >
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>
Re: jmsTemplate + add listener to listener container
Posted by Christian Posta <ch...@gmail.com>.
Those might be good questions to ask in the Spring forum?
On Wed, Jul 3, 2013 at 3:11 PM, Jose María Zaragoza <de...@gmail.com>wrote:
> Hello:
>
> I'm newbie with Apache ActiveMQ and
> I've started using 5.8.0 release + Spring
>
>
> I want that every session created in a servlet container ( Tomcat ),
> subscribes itself as consumer/listener for message from a Topic ( created
> into JMS broker by an admin )
>
> I've got some questions:
>
> If I've got a listener container as
>
> <jms:listener-container concurrency="10" >
> <jms:listener id="QueueListener" destination="Queue.Name"
> ref="queueListener" />
> </jms:listener-container>
> </beans>
>
> 1)
>
> Can I add <jms:listener> ( a.k.a MessageListener ) to Listener Container on
> runtime ?
> I want to add one listener per web session
> How ?
>
> 2)
>
> If I can't,
>
> Can I create a Consumer on runtime and set a MessageListener for it by
> using jmsTemplate?
> I tried to do it with JMS API in jmsTemplate.execute() with
> SessionCallback,
> And a Consumer is created but MessageListener never is called and message
> is never consumed from Topic.
>
> Why ? How ?
>
>
> 3)
>
> If I can't ,
>
> If I use PooledConnectionFactory + JMS API ( no listener-container )
> do I need to close Connection objects and release Consumers/Producers by
> hand ?
>
> Remember I want to create a Consumer per session
>
>
> 4)
>
> Is there other way to do all these things on an easy mode ?
>
>
> Thanks and regards
>
--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta