Products | Versions |
---|---|
TIBCO Enterprise Message Service | - |
Not Applicable | - |
Resolution:
Description:
===============
Integrating JBoss EAP 6.2 with Tibco EMS.
Resolution:
================
JBoss EAP 6.2 provides the Generic JMS Resource Adapter to integrate with a Third-party JMS Provider. You can use the following steps to configure a Generic JMS Resource Adapter within JBoss EAP 6.2 to work with EMS.
Configure a Generic JMS Resource Adapter for EMS within JBOSS EAP 6.2:
1). Create an ObjectFactory implementation for the JNDI binding of queues and topics:
1.1). Using the code below as a template, replace the server details with your JMS provider server values.
=================
import java.util.Hashtable;
import java.util.Properties;
public class RemoteJMSObjectFactory implements ObjectFactory {
private Context context = null;
public RemoteJMSObjectFactory() {
}
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable<?, ?> environment) throws Exception {
try {
String jndi = (String) obj;
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.tibco.tibjms.naming.TibjmsInitialContextFactory");
env.put(Context.URL_PKG_PREFIXES, "com.tibco.tibjms.naming");
env.put(Context.PROVIDER_URL, "tcp://TIBCO_HOST:TIBCO_PORT");
context = new InitialContext(env);
Object o = context.lookup(jndi);
return o;
} catch (NamingException e) {
e.printStackTrace();
throw e;
}
}
}
================
1.2). Compile the above code and save the resulting class file in a JAR file named remoteJMSObjectFactory.jar.
2). Create a genericjms module for your JBoss EAP 6 instance:
2.1). Create the following directory structure: EAP_HOME/modules/system/layers/base/org/jboss/genericjms/provider/main
2.2). Copy the remoteJMSObjectFactory.jar file to EAP_HOME/modules/system/layers/base/org/jboss/genericjms/provider/main
2.3). Copy the binaries required for the provider's JMS implementation to EAP_HOME/modules/system/layers/base/org/jboss/genericjms/provider/main. For Tibco EMS, the binaries required are tibjms.jar and tibcrypt.jar from the Tibco installation's /lib directory.
2.4). Create a module.xml file in EAP_HOME/modules/system/layers/base/org/jboss/genericjms/provider/main as below, listing the JAR files from the previous steps as resources:
<module xmlns="urn:jboss:module:1.1" name="org.jboss.genericjms.provider">
<resources>
<resource-root path="tibjms.jar"/>
<resource-root path="tibcrypt.jar"/>
<resource-root path="remoteJMSObjectFactory.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.jms.api"/>
</dependencies>
</module>
3). Add the generic JMS module as a dependency for all deployments as global modules. For example, EAP_HOME/standalone/configuration/standalone-full.xml is used as the JBoss EAP 6 configuration file.
In EAP_HOME/standalone/configuration/standalone-full.xml, under <subsystem xmlns="urn:jboss:domain:ee:1.1"> , add:
<global-modules>
<module name="org.jboss.genericjms.provider" slot="main"/>
<module name="org.jboss.common-core" slot="main"/>
</global-modules>
4). Replace the default HornetQ resource adapter with the generic resource adapter.