未找到Wildfly 15外部Artemis ActiveMQ目的地 [英] Wildfly 15 external Artemis ActiveMQ destination not found

查看:385
本文介绍了未找到Wildfly 15外部Artemis ActiveMQ目的地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有外部ActiveMQ的野生动物15并使用资源适配器。但我无法连接到队列进行写入。

I have a wildfly 15 with an external ActiveMQ and use a resource adapter. But i cannot get a connection to a queue to write on.

但我可以在队列中听。

这是我的配置:

ironjacamar.xml:

ironjacamar.xml:

<admin-objects>
    <admin-object class-name="org.apache.activemq.command.ActiveMQQueue"
            jndi-name="java:jboss/activemq/queue/HELLOWORLDMDBQueue1234">
        <config-property name="PhysicalName">
                activemq/queue/HELLOWORLDMDBQueue
        </config-property>
    </admin-object>
</admin-objects>

ra.xml:

<adminobject>
    <adminobject-interface>javax.jms.Queue</adminobject-interface>
    <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
    <config-property>
        <config-property-name>PhysicalName</config-property-name>
        <config-property-type>java.lang.String</config-property-type>
    </config-property>
</adminobject>

Bean.java:

Bean.java:

@Resource(lookup = "java:jboss/activemq/queue/HELLOWORLDMDBQueue1234")
private Queue queue;
@Inject
private JMSContext context;
someFunction(){
    context.createProducer().send(queue, "hier ist eine nachricht");
}

我的监听器bean:

@ResourceAdapter("activemq.rar")
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "activemq/queue/HELLOWORLDMDBQueue") })
public class RemoteActiveMQConsumer implements MessageListener {
    @Override
    public void onMessage(Message msg) {
        if (msg instanceof TextMessage) {
            try {
                final String text = ((TextMessage) msg).getText();
                System.out.println(text);
            } catch (final JMSException e) {
                throw new RuntimeException(e);
            }
        } else {
            System.out.println(msg);
        }
    }
}

豆类的pom.xml包含:

pom.xml for Beans contains:

<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-client</artifactId>
    <version>5.9.1</version>
    <scope>provided</scope>
</dependency>

这与资源适配器中的jar版本相同。

this is the same version of jar like in the resource adapter.

HELLOWORLDMDBQueue 读取不是问题,但如果我尝试发送,我会得到以下输出:

Reading from the HELLOWORLDMDBQueue is not a problem, but if i try to send, i get the following output:

错误:

Caused by: javax.jms.InvalidDestinationException: Foreign destination:queue://activemq/queue/HELLOWORLDMDBQueue
at org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.checkDestination(ActiveMQMessageProducer.java:349)
at org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:217)
at org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:206)
at org.apache.activemq.artemis.ra.ActiveMQRAMessageProducer.send(ActiveMQRAMessageProducer.java:142)
at org.apache.activemq.artemis.jms.client.ActiveMQJMSProducer.send(ActiveMQJMSProducer.java:98)

感谢您的帮助

推荐答案

类似于关于此主题的另一个问题,您似乎正在尝试使用ActiveMQ 5.x JCA资源适配器中的admin对象来配置JMS队列管理对象,但之后'使用ActiveMQ Artemis客户端来处理该队列。 ActiveMQ 5.x和ActiveMQ Artemis是完全不同的客户端/服务器实现。你不能这样混合它们。

Similar to your other question on this subject, it appears that you're attempting to use the admin object from the ActiveMQ 5.x JCA resource adapter to configure a JMS queue admin object, but then you're using the ActiveMQ Artemis client to work with that queue. ActiveMQ 5.x and ActiveMQ Artemis are completely different client/server implementations. You can't mix them like that.

你不需要配置任何与ActiveMQ 5.x JCA资源适配器相关的东西。只需在Wildfly的消息子系统中定义队列,然后创建指向远程代理的连接工厂。

You do not need to configure anything related to the ActiveMQ 5.x JCA resource adapter. Simply define your queue in Wildfly's messaging subsystem and create connection factories which point to the remote broker.

这篇关于未找到Wildfly 15外部Artemis ActiveMQ目的地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆