JMS Bridge Between WildFly 10 Artemis and ActiveMQ 5.14 (ONCE_AND_ONLY_ONCE Quality of Service)

好久不见. 提交于 2019-12-02 01:01:19

After posting this question I tried something that seems to have worked. Would still be interested to hear if this is the correct approach though.

When looking at the ra.xml file in the resource adapter I noticed that it offers an additional connection factory as an admin object. So I added the following to the Resource Adapter definition in standalone-full.xml:

                    <admin-object class-name="org.apache.activemq.ActiveMQXAConnectionFactory" jndi-name="java:jboss/activemq/activeMQXAConnectionFactory" use-java-context="true">
                        <config-property name="brokerURL">
                            tcp://localhost:61616?jms.rmIdFromConnectionId=true
                        </config-property>
                    </admin-object>

Using this Connection Factory I then updated the JMS Bridge as follows:

        <jms-bridge name="simple-jms-bridge" add-messageID-in-header="true" max-batch-time="100" max-batch-size="10" max-retries="5" failure-retry-interval="10000" quality-of-service="ONCE_AND_ONLY_ONCE">
            <source destination="jboss/exported/jms/queue/bridgedTestQueue" connection-factory="java:/XAConnectionFactory"/>
            <target destination="jboss/activemq/queue/bridgedTestQueue" connection-factory="java:jboss/activemq/activeMQXAConnectionFactory"/>
        </jms-bridge>

Now all seems to work well. Messages arrive on the ActiveMQ side and I'm not getting any issues in the WildFly log. Whoopwhoop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!