I am working on Spring3.1 in a standalone env.
I am trying to consume messages remotely from a jboss4 machine(having Jboss messaging 1.4 as a the jms provider)
After searching in the net I am kind of lost.
what I have done so far is to config my applicationContext with this:
<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>
and this is my java bean:
@Service("TGWMDB")
public class TGWMDB implements MessageListener
{
@Autowired Topic tgwTopic;
public void onMessage(Message message)
{
}
}
thanks,
ray.
You need a message listener container; it’s all explained here…
http://static.springsource.org/spring-framework/docs/3.1.1.RELEASE/spring-framework-reference/html/jms.html#jms-asynchronousMessageReception