如何通过JMS获取ActiveMQ Artemis中的协议?

问题描述 投票:0回答:2

我正在向 Artemis ActiveMQ 队列发送消息,但我找不到获取消息协议的方法

接收消息体的代码,但是在这个类中我没有找到获取协议的方法:

connectQueueBrowser();
Enumeration<Message> messageEnumeration =  queueBrowser.getEnumeration();
ArrayList<Message> messages = new ArrayList<>();
while (messageEnumeration.hasMoreElements()){
   messages.add(messageEnumeration.nextElement());
}
System.out.println(messages.get(0).getBody(String.class));

Message类在包中:

import javax.jms.Message;

java jms activemq-artemis
2个回答
0
投票

ActiveMQ Artemis 不存储消息通过哪个协议发送。通过管理检查消息时看到的

protocol
值涉及消息如何存储在磁盘上。代理支持 2 种不同的存储格式:

  • 用于通过 AMQP 发送消息(即
    AMQP
  • 一个用于通过每个 other 协议发送的消息(即
    CORE
    )。

无法从任何受支持的 JMS

Message
实现中检索此数据。


-3
投票

ActiveMQ实际上是一个协议,那么“消息协议”是什么意思呢? 您的业务案例是什么?

© www.soinside.com 2019 - 2024. All rights reserved.