Java 带有独立ActiveMQ的wildfly上的ActiveMQ Artemis
我正在尝试使用Java 带有独立ActiveMQ的wildfly上的ActiveMQ Artemis,java,jms,wildfly,activemq-artemis,Java,Jms,Wildfly,Activemq Artemis,我正在尝试使用MDB连接wildfly 10服务器,使用内置的ActiveMQ Artemis连接到运行版本5.13.3的独立ActiveMQ服务器。似乎Artemis无法与任何受支持的ActiveMQ协议通信 ActiveMQ独立代理具有以下transportConnectors: <transportConnectors> <transportConnector name="auto" uri="auto://localhost:5671?protocolDete
MDB
连接wildfly 10服务器,使用内置的ActiveMQ Artemis连接到运行版本5.13.3的独立ActiveMQ服务器。似乎Artemis无法与任何受支持的ActiveMQ协议通信
ActiveMQ独立代理具有以下
transportConnectors
:
<transportConnectors>
<transportConnector name="auto" uri="auto://localhost:5671?protocolDetectionTimeOut=5000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="http" uri="http://0.0.0.0:8180?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600" />
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
根据我选择连接到的连接器,我会在ActiveMQ服务器上收到不同的错误消息 连接到
自动
-端点会产生以下消息:
错误|无法接受连接:java.lang.IllegalStateException:无法检测导线格式
wildfly方面没有错误
连接到
Openwire
-端点会产生以下消息:
警告|传输连接至:tcp://127.0.0.1:45000 失败:java.io.IOException:未知数据类型:77
这也会在wildfly端产生一个错误:
17:04:23384错误[org.apache.activemq.artemis.core.client](Thread-16(activemq-client-netty-threads-1716275972))>AMQ214013:未能解码数据包:java.lang.IllegalArgumentException:AMQ119032:无效类型:1
位于org.apache.activemq.artemis.core.protocol.core.impl.PacketDecoder.decode(PacketDecoder.java:413)
位于org.apache.activemq.artemis.core.protocol.ClientPacketDecoder.decode(ClientPacketDecoder.java:60)
位于org.apache.activemq.artemis.core.protocol.ClientPacketDecoder.decode(ClientPacketDecoder.java:39)
位于org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:324)
位于org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1105)
位于org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:68)
位于io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
位于io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
位于io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
位于io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
位于io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
位于io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
位于io.netty.channel.nio.AbstractNioByteChannel$niobyteensafe.read(AbstractNioByteChannel.java:131)
位于io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
在io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized处(NioEventLoop.java:468)
位于io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
位于io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
位于io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
运行(Thread.java:745)
我可以继续这样做,并在所有端点上接收错误消息。事实上,结果是ActiveMQ Artemis以ActiveMQ不支持的数据格式发送
要将ActiveMQ Artemis与独立的ActiveMQ服务器连接,必须采取哪些步骤?Wildfly 10附带ActiveMQ Artemis,默认情况下,任何MDB都将使用ActiveMQ Artemis JCA RA。ActiveMQ Artemis JCA RA使用仅由ActiveMQ Artemis代理支持的
核心
协议。ActiveMQ 5.x代理无法/不会理解此协议
因此,如果您希望在Wildfly 10上运行的MDB使用来自ActiveMQ 5.x代理的消息,那么您需要部署ActiveMQ 5.x JCA RA(它使用ActiveMQ 5.x代理理解的OpenWire
协议)并配置MDB以使用该协议(例如,通过激活配置属性)
值得一提的是,ActiveMQ Artemis代理确实支持
OpenWire
协议,因此旧版ActiveMQ 5.x客户端可以连接到ActiveMQ Artemis代理。Wildfly 10随ActiveMQ Artemis提供,默认情况下,任何MDB都将使用ActiveMQ Artemis JCA RA。ActiveMQ Artemis JCA RA使用仅由ActiveMQ Artemis代理支持的核心
协议。ActiveMQ 5.x代理无法/不会理解此协议
因此,如果您希望在Wildfly 10上运行的MDB使用来自ActiveMQ 5.x代理的消息,那么您需要部署ActiveMQ 5.x JCA RA(它使用ActiveMQ 5.x代理理解的OpenWire
协议)并配置MDB以使用该协议(例如,通过激活配置属性)
值得一提的是,ActiveMQ Artemis代理确实支持
OpenWire
协议,因此传统的ActiveMQ 5.x客户端可以连接到ActiveMQ Artemis代理。您好,Faro,您能解决这个问题吗。我突然遇到了同样的问题,我想知道是什么原因导致了我的环境发生了变化。我不得不禁用内置的Artemis适配器并部署自己的外部适配器。我最近刚开始出现这个问题,Active MQ在大约8-9个月内没有出现相同的问题sort@MarcodeAbreu你能详细说明一下你的决定吗?也许把它作为对这个问题的回答,请看我上面的回答“我必须禁用内置的Artemis适配器并部署自己的外部适配器”。不幸的是,我真的不记得任何进一步的细节,所以我无法发布正确的答案。你好,法罗,你能解决这个问题吗。我突然遇到了同样的问题,我想知道是什么原因导致了我的环境发生了变化。我不得不禁用内置的Artemis适配器,并部署一个自己的外部适配器。我只是
@MessageDriven(activationConfig =
{
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination", "TestDestination"),
@ActivationConfigProperty(propertyName="clientID", propertyValue = "test"),
@ActivationConfigProperty(propertyName="connectionParameters", propertyValue = "host=127.0.0.1;port=5671"),
@ActivationConfigProperty(propertyName="connectorClassName", propertyValue = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory"),
@ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge")
}, mappedName = "TestDestination")
public class MessageProcessingBean implements MessageListener {