【问题标题】:Queue creation for MDBs in Wildfly在 Wildfly 中为 MDB 创建队列
【发布时间】:2020-05-28 23:33:01
【问题描述】:

我的应用程序中有这样的 MDB

@MessageDriven(activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:jboss/exported/jms/queue/TestQueue"),
        @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "source = 'client'")})
public class JmsReceiver implements MessageListener {

    @Override
    public void onMessage(Message message) {
        // .......
    }

}

问题是队列创建的方式。我记得使用 Wildfly 16 只需使用 MDB 部署应用程序就足够了,并且队列可以远程使用 JNDI 名称 jms/queue/TestQueue 但使用 Wildfly 18 只有在我在服务器控制台中创建具有正确名称的队列后它才开始工作。

Wildfly 和 ActiveMQ 中的队列创建究竟是如何工作的?

【问题讨论】:

    标签: java jms wildfly message-driven-bean java-ee-8


    【解决方案1】:

    我建议您将 jms 目标定义 xml 文件添加到您的部署中。示例见https://docs.jboss.org/author/display/WFLY10/Messaging+configuration

    【讨论】:

    • 谢谢。如果我这样做,我发现它可以工作,但我想更详细地了解它是如何工作的。
    猜你喜欢
    • 2017-04-09
    • 1970-01-01
    • 1970-01-01
    • 2020-04-25
    • 1970-01-01
    • 2016-06-01
    • 2012-02-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多