-
1. Re: MDB in a cluster talking with a remote queue on other cl
paxtor Jan 31, 2005 2:17 AM (in response to paxtor)Hi
Now I'm testing (with Jboss 4.0.1) another configuration. In one computer have a cluster of two instances, which has the JBossMQ HASingleton server. Now in the other computer there are another cluster of two instances with the MDBs. These MDBs are bound by means of a RemoteJMSProvider like in the previous post.
When I test this system, I get another different exception.javax.jms.JMSException: Error creating the dlq connection: XAConnectionFactory
After testing the example of the first post, and this recent example, I take some conclusions:
1) If the JNDIProviderAdapter is configured for url provider for JNDI with (i.e. 192.168.24.13:1099), the configuration runs properly
2) However, if is configured for url provider for HAJNDI (i.e. 192.168.24.13:1100), the server lookups in the local host, regardless the HAJNDI host specifIED.
Is this correct, or I'm doing something wrong?
And the same question, how can I configure the server so that the MDBs can access the remote queue, placed in a cluster, with HAJNDI? -
2. Re: MDB in a cluster talking with a remote queue on other cl
xavierpayne2 Feb 1, 2005 1:35 PM (in response to paxtor)I don't know if this will help but you could try explicitly defining the context settings like this:
Hashtable contextSettings = new Hashtable(); contextSettings.put("jnp.disableDiscovery", "true"); contextSettings.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); contextSettings.put(Context.PROVIDER_URL, 198.162.0.0); contextSettings.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
Change the ip address to whatever the ip is of your remote queue
and then just use this "contextSettings" hashmap in the constructor when you create your InitialContext object you'll use for the lookup.
The jnp.disableDiscovery = true tells the context loader to only try to resolve using the IP provided (instead of the default behavior which is to try attempt to discover and use any valid ip in the cluster).
Hope this helps. -
3. Re: MDB in a cluster talking with a remote queue on other cl
paxtor Feb 2, 2005 3:39 AM (in response to paxtor)Hi all !
Thanks DashV for your reply. I've tried your solution, and the JMS provider was forced to connect to the ports of the cluster nodes. However the error persists even JMS Provider are accessing to correct cluster nodes.javax.jms.JMSException: Error creating the dlq connection: Could not obtain connection to any of these urls: 192.168.24.13:1100,192.168.24.13:1200
and the root error isjavax.naming.CommunicationException: Failed to retrieve stub from server 192.168.24.13:1200 [Root exception is java.io.StreamCorruptedException: unexpected block data]
Next I attach configuration of the JMS Provider, the standardjboss.xml and the jboss.xml portion of the MDB configuration. All these files are related to the jboss server that access to the remote cluster, and contains the MDBs.
JMS provider configuration in jms-ds.xml<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=RemoteJMSProvider,server=remote"> <attribute name="ProviderName">RemoteJMSProvider</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 HAJNDI on the host whatever --> <attribute name="Properties"> jnp.disableDiscovery=true java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=192.168.24.13:1100,192.168.24.13:1200 </attribute> </mbean>
Remote proxy invoker binding configuration at standardjboss.xml<invoker-proxy-binding> <name>remote-driven-bean</name> <invoker-mbean>does-not-matter</invoker-mbean> <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory> <proxy-factory-config> <JMSProviderAdapterJNDI>RemoteJMSProvider</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>
Finally, the MDB configuration at jboss.xml<message-driven> <ejb-name>ServicioCalidad</ejb-name> <destination-jndi-name>/queue/testQueue</destination-jndi-name> <invoker-bindings> <invoker> <invoker-proxy-binding-name>remote-driven-bean</invoker-proxy-binding-name> </invoker> </invoker-bindings> </message-driven>
I wish that anybody could help me
Regards, -
4. Re: MDB in a cluster talking with a remote queue on other cl
paxtor Feb 7, 2005 3:05 AM (in response to paxtor)Has anybody tried a similar configuration?
One cluster with JMS High Availabilty in one of them, and MDBs trying to receive messages through HAJNDI.
Any help will be appreciated.
Regards