I've used the grails-activemq plugin to embed an ActiveMQ broker into a Grails app running in Tomcat 7. The problem is that the broker is only listening for local connections. netstat -an shows this:
tcp 0 0 127.0.0.1:61616 0.0.0.0:* LISTEN
I've set up JNDI in tomcat/conf/context.xml like so
<Context>
<Resource name="jms/ConnectionFactory" auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://10.39.95.39:61616"
brokerName="LocalActiveMQBroker"/>
<Resource name="jms/letterCountQueue" auth="Container"
type="org.apache.activemq.command.ActiveMQQueue" description="letterCountQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="letterCountQueue"/>
</Context>
And grails-app/conf/spring/resources.groovy contains
import org.apache.activemq.ActiveMQConnectionFactory
import org.apache.activemq.broker.TransportConnector
import org.apache.activemq.command.ActiveMQQueue
import org.apache.activemq.xbean.XBeanBrokerService
import org.springframework.jms.core.JmsTemplate
import org.springframework.jms.connection.SingleConnectionFactory
import org.springframework.jms.listener.DefaultMessageListenerContainer
beans = {
jmsBroker(XBeanBrokerService) {
useJmx = 'false'
persistent = 'false'
transportConnectors = [new TransportConnector(uri: new URI('tcp://10.39.95.39:61616'))]
}
jmsFactory(ActiveMQConnectionFactory) {
brokerURL = 'tcp://10.39.95.39:61616'
}
notificationQueue(ActiveMQQueue, 'queue.notification')
jmsTemplate(JmsTemplate) {
connectionFactory = { SingleConnectionFactory cf ->
targetConnectionFactory = ref('jmsFactory')
}
}
}
Where have I specified or accepted as default the fact that the broker does not listen for connections outside of localhost? How can I change that?
Thanks very much,
Lee Grey