-
1. Re: Subscribing to multiple topics (Including Remote Topics)
wdfink Oct 27, 2011 7:59 AM (in response to sapan.vas)1. Yes, need to specify the remote JNDI, depend on the EJB spec you implement
2. No, single MDB provides a onMessage() that listen on one queue/topic
-
2. Re: Subscribing to multiple topics (Including Remote Topics)
sapan.vas Oct 27, 2011 8:46 AM (in response to wdfink)Hi Wolf-Dieter
Thanks for the response.
Regarding (1) I followed the steps to subsribe to the remote Topic on Jboss
I am able to post messages and consume them using a standalone client with the following properties
props.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.factory.url.pkgs","org.jnp.interfaces");
props.put(Context.PROVIDER_URL, "jnp://<reemote_host>1099");
I want the same to be possible through an MDB wherein the details are as under
Annotations on MyMDB
@MessageDriven(name = "MDBExample", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/testTopic"),
@ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue="java:/RemoteJMSProvider")
})
In File $JBOSS_HOME/server/default/deploy/hornetqjms-ds.xml
<!-- Remote JMS Provider -->
<mbean code="org.jboss.jms.jndi.JMSProviderLoader" hornetq:service=JMSProviderLoader,name=RemoteJMSProvider,server=<rremote_host>">
<attribute name="ProviderName">RemoteJMSProvider</attribute>
<attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
<attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
<attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
<attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
<attribute name="Properties">
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jnp.interfaces
java.naming.provider.url=<remote_host>:1099
</attribute>
</mbean>
after this configuration I post messages to the reremote topic using my standalone client.
But the messages are not delivered to the MDB (on My local Jboss6)
Is there any place else that I need to configure something?
BR
Sapan