简体   繁体   English

如何将Java应用程序集成为使用者?

[英]How to integrate my Java application as a consumer?

I have a Java application. 我有一个Java应用程序。 How do I use it as consumer of messages in activemq? 如何将其用作activemq中的消息使用者? Do I need to write any code where I will be passing my name of java application to list it as a consumer? 我需要编写任何代码来传递我的Java应用程序名称以将其列为使用者吗?

Or do I need to integrate any software (like camel, spring) which will help me to achieve this. 还是我需要集成任何可以帮助我实现这一目标的软件(例如骆驼,弹簧)。 Right now what I am looking for is that this Java application needs to be called when activemq gets populated with a message. 现在,我正在寻找的是在activemq中填充消息时需要调用此Java应用程序。

If I need to integrate something into my activemq please put some links which will clearly explain how to go about the integration. 如果我需要将某些东西集成到我的activemq中,请放置一些链接,这些链接将清楚地说明如何进行集成。

PS I am new to activemq and I am super dependent on your help . 附言:我是activemq的新手,我非常依赖您的帮助。

If you are working on a Spring application. 如果您正在使用Spring应用程序。 Or have knowledge of how to work with it, it's pretty simple. 或了解如何使用它,这很简单。

The configuration would be something like this: 配置如下所示:

<bean id="messageListener" class="jmsexample.ExampleListener" />


<bean id="jmsContainer"     class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destination" ref="destination"/>
    <property name="messageListener" ref="messageListener" />
</bean>

Look at the documentation: http://static.springsource.org/spring/docs/3.0.x/reference/jms.html 查看文档: http : //static.springsource.org/spring/docs/3.0.x/reference/jms.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM