Jms-bridge to external AMQ not working . queue not found
Hi,
I get NameNotFoundException when trying to connect to the queue at the external broker.
2020-07-07 02:40:17,944 WARN [org.apache.activemq.artemis.jms.bridge] (Thread-117) AMQ342010: Failed to connect JMS Bridge my-jms-bridge: javax.naming.NameNotFoundException: CoordSend
at org.apache.activemq.artemis.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:236)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.apache.activemq.artemis.jms.bridge.impl.JNDIFactorySupport.createObject(JNDIFactorySupport.java:46)
at org.apache.activemq.artemis.jms.bridge.impl.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:32)
at org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.setupJMSObjects(JMSBridgeImpl.java:1210)
standalone-full.xml
<jms-bridge name="my-jms-bridge" module="org.apache.activemq.artemis" quality-of-service="AT_MOST_ONCE" failure-retry-interval="500" max-retries="1" max-batch-size="10" max-batch-time="100">
<source connection-factory="ConnectionFactory" destination="jboss/jms/queue/CoordSend">
<source-context/>
</source>
<target connection-factory="ConnectionFactory" destination="CoordSend">
<target-context>
<property name="java.naming.factory.initial" value="org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"/>
<property name="java.naming.provider.url" value="tcp://localhost:61616"/>
</target-context>
</target>
</jms-bridge>
Should I use some other module? Or should I use some other connection-factory?
Please advice.
Best regards,
Fredrik
Responses
I don't believe that "jboss/jms/queue/CoordSend" is a correct definition of a local queue. Also you have "ConnectionFactory" for both source and target. That does not make sense.
Are you sure it works? Not sure why would you want to have a jms bridge if you can use RA. Here's a working JMS bridge between TIBCO and EAP
<jms-bridge name="pullBridge" module="org.jboss.genericjms.provider" quality-of-service="ONCE_AND_ONLY_ONCE" failure-retry-interval="60000" max-retries="15" max-batch-size="1" max-batch-time="100">
<source connection-factory="jms/cf/XAQueueConnectionFactory" destination="jms/queue/sourceQueue" user="${tibco.user}" password="${tibco.password}">
<source-context>
<property name="java.naming.factory.initial" value="com.tibco.tibjms.naming.TibjmsInitialContextFactory"/>
<property name="java.naming.factory.url.pkgs" value="com.tibco.tibjms.naming"/>
<property name="java.naming.provider.url" value="tcp://${tibco.host}:${tibco.port}"/>
<property name="java.naming.security.principal" value="${tibco.user}"/>
<property name="java.naming.security.credentials" value="${tibco.password}"/>
<property name="org.jboss.as.naming.lookup.by.string" value="true"/>
</source-context>
</source>
<target connection-factory="java:/BridgeConnectionFactory" destination="java:/jms/queue/targetQueue"/>
</jms-bridge>
<jms-bridge name="pushBridge" module="org.jboss.genericjms.provider" quality-of-service="ONCE_AND_ONLY_ONCE" failure-retry-interval="60000" max-retries="-1" max-batch-size="1" max-batch-time="100">
<source connection-factory="java:/BridgeConnectionFactory" destination="java:/jms/queue/sourceQueue"/>
<target connection-factory="jms/cf/XAQueueConnectionFactory" destination="jms/queue/targetQueue" user="${tibco.user}" password="${tibco.password}">
<target-context>
<property name="java.naming.factory.initial" value="com.tibco.tibjms.naming.TibjmsInitialContextFactory"/>
<property name="java.naming.factory.url.pkgs" value="com.tibco.tibjms.naming"/>
<property name="java.naming.provider.url" value="tcp://${tibco.host}:${tibco.port}"/>
<property name="java.naming.security.principal" value="${tibco.user}"/>
<property name="java.naming.security.credentials" value="${tibco.password}"/>
<property name="org.jboss.as.naming.lookup.by.string" value="true"/>
</target-context>
</target>
</jms-bridge>