The UnionVMS system communicates with Flux through JMS queues and webservice calls. This chapter will handle JMS queues, more specifically the queue bridging need.
To send a request to FLUX, a message has to be put in the bridge queue. To consume a request, a message has to be
in the configured DF queue.
There are two settings that UnionVMS can be set up:
1. UnionVMS and Flux sharing the same JMS broker (figure 1)
(Figure 1)
In this case your outgoing and incoming message queues are on the same JMS broker, hence no configuration is needed.
2. UnionVMS and Flux having each a different JMS broker (Figure 2)
(Figure 2)
If the UnionVMS JMS broker and Flux JMS broker are two different entities, a bridge has to be set up to move messages from one broker to another. Hence a bridge is needed for every queue.
Here is the setup description for JMS bridges operating under Wildfly 8.2.0. If you are using a different application container than Wildfly, try to adapt to the theoretical foundations of this example.
- Add the JMS Implementaiton libraries under your Wildfly classpath : under directory [wildfly installation]\modules\system\layers\base\custom, add a directory bridge. Inside bridge add directory main. Inside main, add module.xml document bearing information on the jar you intend to include. In our case, we are having a bridge between ActiveMQ and Weblogic JMS brokers. Hence we will add the following jars : activemq-all-5.11.1.jar (you can find it under ActiveMQ 5.11.1 directory), and wlthint3client.jar (you can find it under [Oracle Weblogic 12.1.3 installation]\Middleware\Oracle_Home\wlserver\server\lib).
module.xml :
<module xmlns="urn:jboss:module:2.0" name="custom.bridge">
<resources>
<resource-root path="wlthint3client.jar">
<filter>
<exclude-set>
<path name="javax.ejb"/>
<path name="javax.ejb.spi"/>
<path name="javax.transaction"/>
<path name="javax.jms"/>
<path name="javax.xml"/>
<path name="javax.xml.stream"/>
</exclude-set>
</filter>
</resource-root>
<resource-root path="activemq-all-5.11.1.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="sun.jdk" export="false" services="import">
<exports>
<include-set>
<path name="sun/security/acl"/>
<path name="META-INF/services"/>
</include-set>
</exports>
</module>
<module name="com.sun.xml.bind" />
<module name="org.omg.api"/>
<module name="javax.ejb.api" export="false" />
<module name="javax.transaction.api" export="false" />
<module name="javax.jms.api" export="false" />
<module name="javax.xml.stream.api" export="false" />
<module name="org.picketbox" optional="true"/>
<module name="javax.servlet.api" optional="true"/>
<module name="org.jboss.logging" optional="true"/>
<module name="org.jboss.as.web" optional="true"/>
<module name="org.jboss.as.ejb3" optional="true"/>
<module name="org.hornetq" />
</dependencies>
</module>
- setup the embedded Hornet Broker under Wildfly 8.2.0. Setup the appropiate bridges. Under standalone.xml, the messaging subsystem :
<subsystem xmlns="urn:jboss:domain:messaging:2.0">
<subsystem xmlns="urn:jboss:domain:messaging:2.0"> <hornetq-server> <journal-file-size>102400</journal-file-size>
<connectors> <http-connector name="http-connector" socket-binding="http"> <param key="http-upgrade-endpoint" value="http-acceptor"/> </http-connector> <http-connector name="http-connector-throughput" socket-binding="http"> <param key="http-upgrade-endpoint" value="http-acceptor-throughput"/> <param key="batch-delay" value="50"/> </http-connector> <in-vm-connector name="in-vm" server-id="0"/> </connectors>
<acceptors> <http-acceptor http-listener="default" name="http-acceptor"/> <http-acceptor http-listener="default" name="http-acceptor-throughput"> <param key="batch-delay" value="50"/> <param key="direct-deliver" value="false"/> </http-acceptor> <in-vm-acceptor name="in-vm" server-id="0"/> </acceptors>
<security-settings> <security-setting match="#"> <permission type="send" roles="guest"/> <permission type="consume" roles="guest"/> <permission type="createNonDurableQueue" roles="guest"/> <permission type="deleteNonDurableQueue" roles="guest"/> </security-setting> </security-settings>
<address-settings> <address-setting match="#"> <dead-letter-address>jms.queue.DLQ</dead-letter-address> <expiry-address>jms.queue.ExpiryQueue</expiry-address> <max-size-bytes>10485760</max-size-bytes> <page-size-bytes>2097152</page-size-bytes> <message-counter-history-day-limit>10</message-counter-history-day-limit> </address-setting> </address-settings>
<jms-connection-factories> <connection-factory name="InVmConnectionFactory"> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="java:/ConnectionFactory"/> </entries> </connection-factory> <connection-factory name="RemoteConnectionFactory"> <connectors> <connector-ref connector-name="http-connector"/> </connectors> <entries> <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/> </entries> </connection-factory> <pooled-connection-factory name="hornetq-ra"> <transaction mode="xa"/> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="java:/JmsXA"/> <entry name="java:jboss/DefaultJMSConnectionFactory"/> </entries> </pooled-connection-factory> </jms-connection-factories>
<jms-destinations> <jms-queue name="ExpiryQueue"> <entry name="java:/jms/queue/ExpiryQueue"/> </jms-queue> <jms-queue name="DLQ"> <entry name="java:/jms/queue/DLQ"/> </jms-queue> <jms-queue name="sourceQ"> <entry name="jms/sourceQ"/> <entry name="java:jboss/exported/jms/sourceQ"/> </jms-queue> <jms-queue name="bridge"> <entry name="jms/queue/bridge"/> <entry name="java:jboss/exported/jms/queue/bridge"/> </jms-queue> </jms-destinations> </hornetq-server>
<jms-bridge name="bridge-hq-wls" module="custom.oracle.weblogic"> <source> <connection-factory name="ConnectionFactory"/> <destination name="jms/queue/bridge"/> <context> <property key="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/> <property key="java.naming.provider.url" value="tcp://localhost:61617?jms.rmIdFromConnectionId=true"/> </context> </source> <target> <connection-factory name="ConnectionFactory"/> <destination name="jms/queue/bridge"/> <context> <property key="java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory"/> <property key="java.naming.provider.url" value="t3://127.0.0.1:7001"/> <property key="java.naming.provider.principal" value="dubduan"/> <property key="java.naming.provider.credential" value="aleinu78"/> </context> </target> <quality-of-service>AT_MOST_ONCE</quality-of-service> <failure-retry-interval>10000</failure-retry-interval> <max-retries>-1</max-retries> <max-batch-size>500</max-batch-size> <max-batch-time>500</max-batch-time> <add-messageID-in-header>true</add-messageID-in-header> </jms-bridge> <jms-bridge name="bridge-wls-whq" module="custom.oracle.weblogic"> <source> <connection-factory name="ConnectionFactory"/> <destination name="jms/sourceQ"/> <context> <property key="java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory"/> <property key="java.naming.provider.url" value="t3://127.0.0.1:7001"/> <property key="java.naming.provider.principal" value="dubduan"/> <property key="java.naming.provider.credential" value="aleinu78"/> </context> </source> <target> <connection-factory name="ConnectionFactory"/> <destination name="jms/sourceQ"/> <context> <property key="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/> <property key="java.naming.provider.url" value="tcp://localhost:61617?jms.rmIdFromConnectionId=true"/> </context> </target> <quality-of-service>AT_MOST_ONCE</quality-of-service> <failure-retry-interval>10000</failure-retry-interval> <max-retries>-1</max-retries> <max-batch-size>500</max-batch-size> <max-batch-time>500</max-batch-time> <add-messageID-in-header>true</add-messageID-in-header> </jms-bridge>
/ </subsystem>