Yes It works. All you have to do is to configure JBOSS MQ as external JNDI
Provider in the other Application Server. If you are using a session Bean you
can lookup for the external JNDI and if you have to configure the MDB for that
in case of Weblogic it gives a provision like
| <message-driven-descriptor>
| <pool>
| <max-beans-in-free-pool>...</max-beans-in-free-pool>
| <initial-beans-in-free-pool>...</initial-beans-in-free-pool>
| </pool>
| <destination-jndi-name>...</destination-jndi-name>
| <initial-context-factory>...</initial-context-factory>
| <provider-url> </provider-url>
| <connection-factory-jndi-name>..<connection-factory-jndi-name>
| <jms-client-id>.... </jms-client-id>
| </message-driven-descriptor>
|
In some Application servers like Sun One which will not give that provision
to listen in this cases.
Its always good to look for a general solution like tweaking the jms-ra.rar
which is bundled with JBOSS to make it listen to from your Application server
to JBOSS MQ.
The rar comes with a JNDIProvider Adapter which will look for
java:/DefaultJMSProvider some application servers would not accept this naming
you can modify 2 classes that comes with the rar to make it work in a
generalized way.
In the package org.jboss.resource.adapter.jms.inflow.JmsActivationSpec bean
add the following parameters and also the corresponding methods
| private String providerURL = "jnp://localhost:1099";
| private String initialContextFactory =
"org.jnp.interfaces.NamingContextFactory";
| private String urlPkgPrefixes = "org.jnp.interfaces";
In the package org.jboss.resource.adapter.jms.inflow.JmsActivation bean make
the following changes
protected void setupJMSProviderAdapter() throws Exception
| {
|
| Properties env = new java.util.Properties();
|
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,spec.getInitialContextFactory());
| env.put(javax.naming.Context.PROVIDER_URL,spec.getProviderURL());
|
env.put(javax.naming.Context.URL_PKG_PREFIXES,spec.getUrlPkgPrefixes());
| adapter = new org.jboss.jms.jndi.JNDIProviderAdapter();
| adapter.setProperties(env);
| log.debug("Using jms provider adapter " + adapter);
| }
and in 2 more methods setupTopicConnection and setupQueueConnection make
changes to lookup for ConnectionFactory.
TopicConnectionFactory tcf = (TopicConnectionFactory)
ctx.lookup("ConnectionFactory");
while giving the ActiovationSpec in your ejb-jar.xml give the properties in
the JmsActiovation spec like:
<activation-config>
| <activation-config-property>
|
<activation-config-property-name>destination</activation-config-property-name>
|
<activation-config-property-value>queue/A</activation-config-property-value>
| </activation-config-property>
| <activation-config-property>
|
<activation-config-property-name>destinationType</activation-config-property-name>
|
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
| </activation-config-property>
| <activation-config-property>
|
<activation-config-property-name>providerURL</activation-config-property-name>
|
<activation-config-property-value>jnp://localhost:1099</activation-config-property-value>
| </activation-config-property>
| <activation-config-property>
|
<activation-config-property-name>initialContextFactory</activation-config-property-name>
|
<activation-config-property-value>org.jnp.interfaces.NamingContextFactory</activation-config-property-value>
| </activation-config-property>
| <activation-config-property>
|
<activation-config-property-name>urlPkgPrefixes</activation-config-property-name>
|
<activation-config-property-value>org.jnp.interfaces</activation-config-property-value>
| </activation-config-property>
| </activation-config>
|
you can replace the localhot parameter with the machine ip or the name on
which the JBOSS MQ is running .
Since the rar itself will provide for the JNDI providerAdapter too you need
not configure the external JNDI in this case. All you have to do is to point to
the rar as an example the sunone
| <sun-ejb-jar>
| <enterprise-beans>
| <ejb>
| <ejb-name>MessageBean</ejb-name>
| <jndi-name>test/myQueue</jndi-name>
| <mdb-resource-adapter>
| <resource-adapter-mid>jms-ra</resource-adapter-mid>
| </mdb-resource-adapter>
| </ejb>
| </enterprise-beans>
| </sun-ejb-jar>
|
Note: You might want to do away with the DLQ then comment out the call
setupDLQ(ctx) in the setup() method of the JmsActiovation.java
enjoy...
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3870482#3870482
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3870482
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user