1
votes

I am trying to use MDB to connect a wildfly 10 server using the inbuilt ActiveMQ Artemis to connect to my standalone ActiveMQ-Server running version 5.13.3. It seems like Artemis is not able to communicate with any of the supported ActiveMQ-Protocols.


ActiveMQ standalone broker has the following transportConnectors:

<transportConnectors>
    <transportConnector name="auto" uri="auto://localhost:5671?protocolDetectionTimeOut=5000&amp;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="http" uri="http://0.0.0.0:8180?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600" />
    <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> 
    <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> 
    <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/> 
    <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

Wildfly MessageBean has the following 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 {

Depending on the connector I choose to connect to, I receive different error-messages on the ActiveMQ-Server.

Connecting to the auto-endpoint yields the following message:

ERROR | Could not accept connection : java.lang.IllegalStateException: Could not detect the wire format

No error on the wildfly-side.


Connection to the Openwire-endpoint yields the following message:

WARN | Transport Connection to: tcp://127.0.0.1:45000 failed: java.io.IOException: Unknown data type: 77

this also yields an error on the wildfly-side:

17:04:23,384 ERROR [org.apache.activemq.artemis.core.client] (Thread-16 (ActiveMQ-client-netty-threads-1716275972)) > AMQ214013: Failed to decode packet: java.lang.IllegalArgumentException: AMQ119032: Invalid type: 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.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:68) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.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.java: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.run(NioEventLoop.java:354) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) at java.lang.Thread.run(Thread.java:745)

I could go so on and receive errormessages on all endpoints. The result in fact is that ActiveMQ-Artemis is sending in a data format which is not supported by ActiveMQ.

Which steps have to be taken to connect ActiveMQ-Artemis with a standalone ActiveMQ-Server?

1
hello Faro were you able to solve this. I am having the same issue suddenly and wanted to know what has changed in my environment that caused this.sarmahdi
I had to disable the built-in Artemis-Adapter and deploy an own external adapterMarco de Abreu
Well i just started having this issue recently, Active MQ was wokring fine for like 8-9 months without issue of the same sortsarmahdi
@MarcodeAbreu Can you elaborate on what your resolution was? Perhaps post it as an answer to this question.user130532
Please see my answer above "I had to disable the built-in Artemis-Adapter and deploy an own external adapter". Unfortunately, I can't really remember any further details so I won't be able to post a proper answer.Marco de Abreu

1 Answers

4
votes

Wildfly 10 ships with ActiveMQ Artemis, and by default any MDB will use the ActiveMQ Artemis JCA RA. The ActiveMQ Artemis JCA RA uses the core protocol which is only supported by the ActiveMQ Artemis broker. The ActiveMQ 5.x broker can't/won't understand this protocol.

Therefore, if you want an MDB running on Wildfly 10 to consume messages from an ActiveMQ 5.x broker then you'll need to deploy the ActiveMQ 5.x JCA RA (which speaks the OpenWire protocol which the ActiveMQ 5.x broker understands) and configure the MDB to use that (e.g. via the activation configuration properties).

For what it's worth, the ActiveMQ Artemis broker does support the OpenWire protocol so legacy ActiveMQ 5.x clients can connect to the ActiveMQ Artemis broker.