MDB
내장 ActiveMQ Artemis를 사용하여 버전 5.13.3을 실행하는 독립 실행 형 ActiveMQ-Server에 연결하는 데 사용하려고합니다 . 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>
Wildfly MessageBean 에는 다음이 있습니다 Annotation
.
@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 {
연결하기로 선택한 커넥터에 따라 ActiveMQ-Server에서 다른 오류 메시지를받습니다.
auto
-endpoint에 연결 하면 다음 메시지가 생성됩니다.
오류 | 연결을 수락 할 수 없습니다 : java.lang.IllegalStateException : 연결 형식을 감지 할 수 없습니다.
wildfly-side에 오류가 없습니다.
Openwire
-endpoint에 연결 하면 다음 메시지가 생성됩니다.
경고 | 전송 연결 : tcp : //127.0.0.1 : 45000 실패 : java.io.IOException : 알 수없는 데이터 유형 : 77
이것은 또한 wildfly 측에 오류를 생성합니다.
17 : 04 : 23,384 오류 [org.apache.activemq.artemis.core.client] (Thread-16 (ActiveMQ-client-netty-threads-1716275972))> AMQ214013 : 패킷 디코딩 실패 : java.lang.IllegalArgumentException : AMQ119032 : 잘못된 유형 : 1 at org.apache.activemq.artemis.core.protocol.core.impl.PacketDecoder.decode (PacketDecoder.java:413) at org.apache.activemq.artemis.core.protocol.ClientPacketDecoder.decode (ClientPacketDecoder .java : 60) at org.apache.activemq.artemis.core.protocol.ClientPacketDecoder.decode (ClientPacketDecoder.java:39) at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived (RemotingConnectionImpl .java : 324) at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl $ DelegatingBufferHandler.bufferReceived (ClientSessionFactoryImpl.java:1105) at org.apache.activemq.artemis.core.remoting.impl.netty.io.netty.handler의 io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:294)의 io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:308)의 ActiveMQChannelHandler.channelRead (ActiveMQChannelHandler.java:68) .codec.ByteToMessageDecoder.channelRead (ByteToMessageDecoder.java:265) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead (AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead (AbstractChannelHandlerContext.java:294) at io. netty.channel.DefaultChannelPipeline.fireChannelRead (DefaultChannelPipeline.java:846) at io.netty.channel.nio.AbstractNioByteChannel $ NioByteUnsafe.read (AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey (NioEventLoop. 자바:511) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized (NioEventLoop.java:468) at io.netty.channel.nio.NioEventLoop.processSelectedKeys (NioEventLoop.java:382) at io.netty.channel.nio.NioEventLoop io.netty.util.concurrent.SingleThreadEventExecutor $ 2.run (SingleThreadEventExecutor.java:112)의 .run (NioEventLoop.java:354) java.lang.Thread.run (Thread.java:745)
계속해서 모든 엔드 포인트에서 오류 메시지를받을 수 있습니다. 그 결과 ActiveMQ-Artemis는 ActiveMQ에서 지원하지 않는 데이터 형식으로 전송합니다.
ActiveMQ-Artemis를 독립형 ActiveMQ-Server와 연결하려면 어떤 단계를 수행해야합니까?
Wildfly 10은 ActiveMQ Artemis와 함께 제공되며 기본적으로 모든 MDB는 ActiveMQ Artemis JCA RA를 사용합니다. ActiveMQ Artemis JCA RA는 core
ActiveMQ Artemis 브로커에서만 지원 하는 프로토콜을 사용합니다 . ActiveMQ 5.x 브로커는이 프로토콜을 이해하지 못합니다.
따라서 Wildfly 10에서 실행되는 MDB가 ActiveMQ 5.x 브로커의 메시지를 사용하도록하려면 ActiveMQ 5.x JCA RA ( OpenWire
ActiveMQ 5.x 브로커가 이해 하는 프로토콜을 말함)를 배포해야합니다. 이를 사용하도록 MDB를 구성합니다 (예 : 활성화 구성 속성을 통해).
그만한 가치는 ActiveMQ Artemis 브로커가 OpenWire
프로토콜을 지원 하므로 레거시 ActiveMQ 5.x 클라이언트가 ActiveMQ Artemis 브로커에 연결할 수 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다