我是grails和jms的初学者,我正在尝试对来自glassfish的消息进行简单的消息监听。
my grails-app / spring / resources.groovy
beans = {
myQueueFactory(SingleConnectionFactory) {
targetConnectionFactory = { ActiveMQConnectionFactory cf ->
brokerURL = 'tcp://localhost:7676'
}
}
的grails-app / Config.groovy中
jms {
containers {
standard {
autoStartup = true
connectionFactoryBean = "myQueueFactory"
}
}
}
MyService.groovy
class MyService {
static exposes = ['jms']
static destination = 'myQueue'
def onMessage(msg) {
println msg
}
}
但是当我发送消息时,没有发生!这里有些不对劲? glassfish和grails app都在同一个localhost中运行。
提前感谢!
答案 0 :(得分:1)
您是否已安装并运行ActiveMQ?
static destination = 'myQueue'
如何跳转使用'myQueueFactory'?