java ee - Using .BINDING File with MDB in Jboss EAP6.4 -


i writing standard java ee 5 application , need consume jms messages (hornetq) mq serverv8. mq admin has provided .bindings file mq configuration. after searching web, not able find way use .bidings file mdbs. have tried using standard activation spec. works fine. that, jms properties need in jboss or ee specific configuration files. can please tell way use .bindings file mdb?

how decide jndi , initial context factory name ?

while possible use .bindings file mdb activation specification, turns out impractical. can specify destination in both .bindings file , mdb activation spec, not connection factory. attributes configure connection factory (i.e. host, port, channel, etc.) configured individually in activation spec.

what can use .bindings file configure jms messaging bridge mq jboss. then, mdb listens on local hornetq destination. in order working, need to:

1) create ibm mq client module. messaging bridge not using ibm jca. on unix mq server, find client jars in /opt/mqm/java/lib/ directory.

i created module following jar files:

./system/layers/base/com/ibm/wmqclient75 ./system/layers/base/com/ibm/wmqclient75/main ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.tools.ras.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.axis2.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.headers.jar ./system/layers/base/com/ibm/wmqclient75/main/ldap.jar ./system/layers/base/com/ibm/wmqclient75/main/cl3nonexport.jar ./system/layers/base/com/ibm/wmqclient75/main/providerutil.jar ./system/layers/base/com/ibm/wmqclient75/main/connector.jar ./system/layers/base/com/ibm/wmqclient75/main/jta.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.soap.jar             ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.jms.nojndi.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mqjms.jar ./system/layers/base/com/ibm/wmqclient75/main/rmm.jar ./system/layers/base/com/ibm/wmqclient75/main/jms.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.commonservices.jar ./system/layers/base/com/ibm/wmqclient75/main/fscontext.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.pcf.jar ./system/layers/base/com/ibm/wmqclient75/main/cl3export.jar ./system/layers/base/com/ibm/wmqclient75/main/jndi.jar ./system/layers/base/com/ibm/wmqclient75/main/com.ibm.mq.jmqi.jar ./system/layers/base/com/ibm/wmqclient75/main/dhbcore.jar ./system/layers/base/com/ibm/wmqclient75/main/module.xml 

my module.xml file:

<?xml version="1.0" encoding="utf-8"?>  <module xmlns="urn:jboss:module:1.0" name="com.ibm.wmqclient75"> <resources> <resource-root path="com.ibm.mq.commonservices.jar" /> <resource-root path="com.ibm.mq.headers.jar" /> <resource-root path="com.ibm.mq.jar" /> <resource-root path="com.ibm.mq.jmqi.jar" /> <resource-root path="com.ibm.mqjms.jar" /> <resource-root path="com.ibm.mq.pcf.jar" />  <resource-root path="connector.jar" /> <resource-root path="dhbcore.jar" /> <resource-root path="fscontext.jar"/> <resource-root path="providerutil.jar"/> </resources>  <dependencies>    <!-- add dependencies required jms bridge code                -->    <module name="javax.api"/>    <module name="javax.resource.api"/>    <module name="javax.jms.api"/>    <module name="javax.transaction.api"/>    <module name="org.jboss.remote-naming"/>    <!-- depend on org.hornetq module since send messages  -->    <!-- hornetq server embedded in local as7 instance           -->    <module name="org.hornetq"/> </dependencies> </module> 

2) can load configure bridge:

<subsystem xmlns="urn:jboss:domain:messaging:1.4"> .... .... ....             <jms-bridge name="wmqbridge" module="com.ibm.wmqclient75">             <target>                 <connection-factory name="xaconnectionfactory"/>                 <destination name="jms/queue/test"/>             </target>             <source>                 <connection-factory name="mqcf"/>                 <destination name="mqqueue"/>                 <context>                     <property key="java.naming.factory.initial" value="com.sun.jndi.fscontext.reffscontextfactory"/>                     <property key="java.naming.provider.url" value="file:///${jboss.server.data.dir}/bindings/"/>                 </context>             </source>             <quality-of-service>once_and_only_once</quality-of-service>             <failure-retry-interval>500</failure-retry-interval>             <max-retries>1</max-retries>             <max-batch-size>1</max-batch-size>             <max-batch-time>1000000</max-batch-time>             <add-messageid-in-header>true</add-messageid-in-header>         </jms-bridge>     </subsystem> 

note refernnce module:

<jms-bridge name="wmqbridge" module="com.ibm.wmqclient75"> 

my names destination , connection factory, found in .bindings file:

                <connection-factory name="mqcf"/>                 <destination name="mqqueue"/> 

i created directory under standard data directory named bindings , placed .bindings file in it:

<property key="java.naming.provider.url" value="file:///${jboss.server.data.dir}/bindings/"/> 

that messages locally on destination can access.

  • doug

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -