-
1. Re: Can't configure an MDB to a remote destination
jaikiran May 31, 2006 3:42 AM (in response to rob.hadfield)Well i do have it working without any issues. In my case the remote queue is named queueOn2177 and is deployed on the remote server using the following entry in jbossmq-destinations-service.xml file:
<mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=queueOn2177"> <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends> </mbean>
Then on my local machine, i have configured my MDB to look up this remote queue, by configuring the same in 3 files, namely ejb-jar.xml, jboss.xml and jms-ds.xml as follows:
jboss.xml:
<message-driven> <ejb-name>SomeMDB</ejb-name> <destination-jndi-name>queue/queueOn2177</destination-jndi-name> <invoker-bindings> <invoker> <invoker-proxy-binding-name>MyMDBInvoker</invoker-proxy-binding-name> </invoker> </invoker-bindings> </message-driven>
<invoker-proxy-bindings> <invoker-proxy-binding> <name>MyMDBInvoker</name> <invoker-mbean>SomeMDB</invoker-mbean> <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory> <proxy-factory-config> <JMSProviderAdapterJNDI>MyJMSProvider</JMSProviderAdapterJNDI> <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI> <MinimumSize>1</MinimumSize> <KeepAliveMillis>30000</KeepAliveMillis> <MaximumSize>15</MaximumSize> <MaxMessages>1</MaxMessages> <MDBConfig> <ReconnectIntervalSec>10</ReconnectIntervalSec> <DLQConfig> <DestinationQueue>queue/DLQ</DestinationQueue> <MaxTimesRedelivered>10</MaxTimesRedelivered> <TimeToLive>0</TimeToLive> </DLQConfig> </MDBConfig> </proxy-factory-config> </invoker-proxy-binding> </invoker-proxy-bindings>
jms-ds.xml:<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=RemoteMQProvider,server=ps2177"> <!--this name will be used in jboss.xml--> <attribute name="ProviderName">MyJMSProvider</attribute> <!--Points to remote server--> <attribute name="ProviderUrl">jnp://ps2177:1099</attribute> <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JBossMQProvider</attribute> <attribute name="QueueFactoryRef">UIL2XAConnectionFactory</attribute> <attribute name="TopicFactoryRef">UIL2XAConnectionFactory</attribute> </mbean>
ejb-jar.xml:<message-driven> <ejb-name>SomeMDB</ejb-name> <ejb-class>mypackage.myClass</ejb-class> <transaction-type>Container</transaction-type> <message-driven-destination> <destination-type>javax.jms.Queue</destination-type> </message-driven-destination> </message-driven>
-
2. Re: Can't configure an MDB to a remote destination
obn May 31, 2006 4:14 PM (in response to rob.hadfield)where do you put those three files? in the META-INF directory of the project?
my problem is that my mdb does not listen to incoming messages,
so maybe i forgot a descriptive file like yours so that it is not deployed correctly.
config:
- jboss 4.0.4GA
- jboss-messaging-1.0.1.CR2
- jboss-EJB-3.0_RC6-PFD
when i deploy the mdb example i'm able to connect and send messages from a remote system, they're processed by the MDBExample mdb. -
3. Re: Can't configure an MDB to a remote destination
rob.hadfield May 31, 2006 6:51 PM (in response to rob.hadfield)Thanks jaikiran, I solved the problem although I'm not happy about it! In my jms-ds.xml I had specified:
<attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
which is how the DefaultJMSProvider is configured. When I changed this to<attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
as in your post, it magically works! So I don't understand why these references should be different.
I rechecked server.log (trace is enabled for org.jboss.jms) but there was no indication of a problem with the reference.
Nevertheless my remote MDB now works which is a *great* relief... 8-) Thanks again. -
4. Re: Can't configure an MDB to a remote destination
rob.hadfield May 31, 2006 7:00 PM (in response to rob.hadfield)Hi obn,
In my configuration my ejb jar file looks like this:
com/mycompany/mypackage/mbdclassfile.class
meta-inf/ejb-jar.xml
meta-inf/jboss.xml
jms-ds.xml is in your JBossHome/server/*configuration*/deploy/jms
It sounds like you have another MDB (MDBExample) listening to the same queue...