【问题标题】:Grails jms remote listener not workingGrails jms远程侦听器不起作用
【发布时间】:2013-08-21 09:17:27
【问题描述】:

我是 grails 和 jms 的初学者,我正在尝试对来自 glassfish 的消息做一个简单的消息监听器。

我的 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 应用程序都在同一个 localhost 中运行。

提前致谢!

【问题讨论】:

    标签: grails jms


    【解决方案1】:

    你看过http://gpc.github.io/grails-jms/docs/manual/index.html吗?

    您是否安装并运行了 ActiveMQ?

    static destination = 'myQueue' 如何跳转到使用“myQueueFactory”?

    【讨论】:

    • 我试图做的是连接到 glassfish 中称为 myQueueFactory 的连接工厂,有一个 myQueue,我认为可以制作胶水。但是我实际上退出了这个插件并开始使用rabbitmq,因为这个插件似乎很久没有更新了,但还是感谢您的回答!
    猜你喜欢
    • 1970-01-01
    • 2014-12-23
    • 2017-09-27
    • 1970-01-01
    • 2020-12-25
    • 1970-01-01
    • 2013-04-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多