How to connect a remote jms client to an embedded activemq broker in tomcat?

rusuh

New Member
I have an embedded broker in tomcat that my webapp clients are connecting to fine using vm://localhost. I would like some remote clients in another jvm be able to connect to the embedded broker. How do I set up the embedded broker to listen on a port#? This works for embedded clients: server.xml fragment: \[code\]<Resource auth="Container" name="jms/ConnectionFactory" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="vm://localhost" brokerName="MyActiveMQBroker" useEmbeddedBroker="true"/> \[/code\]This isn't working for remote clients, but my embedded clients still connect using vm://localhost: \[code\]<Resource auth="Container" name="jms/ConnectionFactory" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="vm:(broker:(tcp://localhost:61616))" brokerName="MyActiveMQBroker" useEmbeddedBroker="true"/> \[/code\]My remote clients give this error: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused I also have been trying this: \[code\]brokerURL="vm://localbroker?brokerConfig=xbean:file:C:/temp/activemq.xml"\[/code\]and in the activemq.xml, setting this:\[code\]<transportConnectors><transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/></transportConnectors><networkConnectors><networkConnector uri="static:(tcp://0.0.0.0:61616)"/></networkConnectors>\[/code\]I don't believe the xml file is getting read, because my symptoms never change when editing it. On tomcat startup, when the first client webapp deploys, the broker starts and reports that: Connector vm://localhost StartedI never see another connector started, like tcp://0.0.0.0:61616. Is this possible?
 
Back
Top