0

我正在一个独立的环境中研究 Spring3.1。

我正在尝试从 jboss4 机器远程使用消息(将 Jboss 消息传递 1.4 作为 jms 提供程序)

在网上搜索后,我有点迷路了。

到目前为止我所做的是用这个配置我的applicationContext:

<bean id="tgwTopic" class="org.springframework.jndi.JndiObjectFactoryBean"
    depends-on="jmsServerManagerImpl">
    <property name="jndiName" value="/topic/feedTopicRealTime" />
    <property name="jndiEnvironment">

        <props>
            <prop key="java.naming.provider.url">remove.server.url:1099</prop>
            <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
            <prop key="java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces</prop>
            <!-- other key=values here -->
        </props>
    </property>
</bean>

这是我的java bean:

   @Service("TGWMDB")
public class TGWMDB implements MessageListener
{
       @Autowired   Topic tgwTopic;

      public void onMessage(Message message)
      {
      }

}

谢谢,雷。

4

1 回答 1

0

您需要一个消息侦听器容器;这一切都在这里解释...

http://static.springsource.org/spring-framework/docs/3.1.1.RELEASE/spring-framework-reference/html/jms.html#jms-asynchronousMessageReception

于 2012-07-04T12:19:46.903 回答