-
1. Re: Problem publishing messages to a remote Queue
jaikiran Apr 18, 2006 10:55 PM (in response to stevech10)Post the code where you are looking up the remote queue in your session bean. I believe its mainly got to do with the InitialContext properties.
-
2. Re: Problem publishing messages to a remote Queue
stevech10 Apr 19, 2006 9:19 AM (in response to stevech10)Thank you for your interest.
Here is the initial context lookup - although I was hoping not to have to hard code this:
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
properties.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
properties.put(Context.PROVIDER_URL, URL_NAME);
jndiContext = new InitialContext(properties);
Also, here's my JMS loader provider from jms-ds.xml (remoteserver replaced with actual server):
QueuehostJMSProvider
org.jboss.jms.jndi.JNDIProviderAdapter
<!-- The combined connection factory -->
XAConnectionFactory
<!-- The queue connection factory -->
XAConnectionFactory
<!-- The topic factory -->
XAConnectionFactory
<!-- Connect to JNDI on the host "queuehost" port 1099 -->
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jnp.interfaces
java.naming.provider.url=remoteserver:1099
Finally, I have a remote proxy binding setup up in jboss.xml that I successfully invoke to consume from a remote topic. I was hoping I could use the same proxy binding to publish to the remote queue:
<invoker-proxy-bindings>
<invoker-proxy-binding>
my-mdb-invoker
<invoker-mbean>does-not-matter</invoker-mbean>
<proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
<proxy-factory-config>
QueuehostJMSProvider
StdJMSPool
1
30000
15
1
10
queue/DLQ
10
0
</proxy-factory-config>
</invoker-proxy-binding>
</invoker-proxy-bindings> -
3. Re: Problem publishing messages to a remote Queue
stevech10 Apr 19, 2006 9:34 AM (in response to stevech10)Sorry, I noticed the invoked binding and JMS remote loader did not paste correctly, here they are again:
JMS remote loader in jmd-ds.xml:<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=RemoteJMSProvider,server=purple05.ed.ray.com"> <attribute name="ProviderName">QueuehostJMSProvider</attribute> <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute> <!-- The queue connection factory --> <attribute name="QueueFactoryRef">XAConnectionFactory</attribute> <!-- The topic factory --> <attribute name="TopicFactoryRef">XAConnectionFactory</attribute> <!-- Connect to JNDI on the host "queuehost" port 1099 --> <attribute name="Properties"> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jnp.interfaces java.naming.provider.url=purple05.ed.ray.com:1099 </attribute> </mbean>
Proxy binding in jboss.xml:<invoker-proxy-bindings> <invoker-proxy-binding> <name>my-mdb-invoker</name> <invoker-mbean>does-not-matter</invoker-mbean> <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory> <proxy-factory-config> <JMSProviderAdapterJNDI>QueuehostJMSProvider</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>
And here's the initial context lookup:Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); properties.put(Context.PROVIDER_URL, URL_NAME); jndiContext = new InitialContext(properties);