[rabbitmq-discuss] To declare a MQ listener at java application startup

Jon Brisbin jon.brisbin at npcinternational.com
Mon Aug 9 18:52:13 BST 2010


On Aug 9, 2010, at 12:47 PM, archana v wrote:

> Thanks for your reply.I  am not using spring.. I am trying to configure it at servlet init. But it doesn seem to work. I dont know if my method of declaring the listener is right. It would be helpful if you could send me some samples.

Sorry, I don't have any example of using servlet init because I use Spring.

Maybe you could show a little of what you're trying to do?

Are you including <load-on-startup>1</load-on-startup> in your servlet init?

jb


> 
> 
> Thanks and Regards,
> Archana 
> 
> On Mon, Aug 9, 2010 at 1:43 PM, Jon Brisbin <jon.brisbin at npcinternational.com> wrote:
> There's actually a lot of ways to go about this:
> 
> 1) If you're using Spring, then just configure a bean in your app-context.xml. 
> 
> 2) You could use the new spring-amqp classes: http://www.springsource.org/spring-amqp
> 
> 3) You could manually configure them from the servlet init method.
> 
> I also run listeners that integrate with the Tomcat server. You can configure them in different ways depending on the context. You could set up a global naming resource, or you could scope it to your web application by putting it in META-INF/context.xml: http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
> 
> Jon Brisbin
> Portal Webmaster
> NPC International, Inc.
> 
> 
> 
> On Aug 9, 2010, at 11:33 AM, archana v wrote:
> 
>> Hi All,
>> 
>> I am new to rabbit-mq. I would like to know  how to start a MQ listner(Java Client) to listen to a queue at the application start up.  I am deploying my application in tomcat server.
>> Thanks in advance for your help.
>> 
>> 
>> Thanks and Regards,
>> Archana 
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100809/f6a15de2/attachment.htm>


More information about the rabbitmq-discuss mailing list