Thanks for your answer Yes I'm aware of some change in this area and I understand why it has been changed.
JMSToolBox (JTB) is an "universal" eclipse-rcp based JMS client that deals with JMS messages in Queues and Topics based on one eclipse pulgin per Queue Manager (Artemis, IBM MQ, ActiveMQ etc.)
The main difficulty is to retrieve the list of Queues and Topics from a Queue Manager as the JMS standard does not define an API for that, so it is Queue Manager specific. When JTB has those lists, it use seamlessly plain JMS API
Currently, JMSToolBox works well with Artemis v1.x and has no problem retrieving the list of Queues and Topics, As the management model changed in v2.x, it has to be changed also
I have the code to retrieve those lists with the v1.x client jars from a v1.x server (Currently in JTB), and from a v2.x client to a v2.x server
In an ideal world, the JTB Artemis plugin would use the latest client jar (v2.x as I guess it will be the one that will evolve with time) and be able to seamlessly retrieve those lists from any version of Artemis. (v1.x , v2.x)
You said before that v2.x client jars are not compatible with v1.x servers, and if I use the v1.x client jars (with the replacement of "JMSManagementHelper" by "ManagementHelpe"r as you suggest), it will/may work but I will be stuck with the 1.x client jars in JTB
So I guess the only solution left for JTB is to have 2 plugins for Artemis. one "legacy" with v1.x client jars target to v1.x servers in the "old management" way to retrieve the list og Q/T, and one "v2.x" plugin with the newest code based on the "Address model"
Again, thanks for your help (And the good job on Artemis) Denis (Author of JMSToolBox on sourceforge) Le 28/03/2017 à 05:23, Martyn Taylor a écrit :
Ah I see you are using the JMSManagement API. This goes beyond plain JMS and unfortunately is not supported in 2.0.0. It was one of the main reasons we needed to do a major release as the architecture change required removal of server side JMS components. You can do all the same stuff using the org.apache.activemq.artemis.api.core.management.ManagementHelper (which uses the Artemis CORE API). The addressing model has changed slightly in Artemis, in that you will need to create addresses and queues vs JMS topics queues. See the chapter on the latest address model for more information: https://activemq.apache.org/artemis/docs/2.0.0/address-model.html Thanks On Mon, Mar 27, 2017 at 10:38 PM, titou10 <[email protected]> wrote:It does not to work the other way either: Java client with the Artemis v1.5.3 client jar on the classpath trying to talk to a v2.0.0 server It fails with an exception on the client side: java.lang.IndexOutOfBoundsException: readerIndex(22) + length(276) exceeds writerIndex(294): UnpooledDuplicatedByteBuf(ridx: 22, widx: 294, cap: 629, unwrapped: UnpooledUnsafeHeapByteBuf(ridx: 617, widx: 629, cap: 629)) As the exception seems to be in netty, I tested it with netty-all-4.1.5.Final.jar (from Artemis v1.5.3) and netty-all-4.1.6.Final.jar (from v2.0.0) Should I open a JIRA or is there something wrong with my code / config ? Thanks Denis (Author of JMSToolBox on sourceforge) =================== The code: Session sessionJMS = ... Queue managementQueue = ActiveMQJMSClient.createQueue( "activemq.management"); QueueRequestor requestorJMS = new QueueRequestor((QueueSession) sessionJMS, managementQueue); Message m = sessionJMS.createMessage(); JMSManagementHelper.putAttribute(m, "broker", "queueNames"); Message r = requestorJMS.request(m); --> fails here The client side exception : java.lang.IndexOutOfBoundsException: readerIndex(22) + length(276) exceeds writerIndex(294): UnpooledDuplicatedByteBuf(ridx: 22, widx: 294, cap: 629, unwrapped: UnpooledUnsafeHeapByteBuf(ridx: 617, widx: 629, cap: 629)) at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(Abstract ByteBuf.java:1395) at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractB yteBuf.java:1389) at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf. java:850) at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf. java:858) at io.netty.buffer.WrappedByteBuf.readBytes(WrappedByteBuf. java:649) at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferW rapper.readSimpleStringInternal(ChannelBufferWrapper.java:93) at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferW rapper.readNullableSimpleString(ChannelBufferWrapper.java:73) at org.apache.activemq.artemis.api.core.management.ManagementHe lper.getResults(ManagementHelper.java:196) at org.apache.activemq.artemis.api.core.management.ManagementHe lper.getResult(ManagementHelper.java:224) at org.apache.activemq.artemis.api.jms.management.JMSManagement Helper.getResult(JMSManagementHelper.java:149) at org.apache.activemq.artemis.api.jms.management.JMSManagement Helper.getResult(JMSManagementHelper.java:139) at org.titou10.jtb.qm.activemq.ActiveMQArtemisQManager.connect( ActiveMQArtemisQManager.java:148) Le 24/03/2017 à 09:33, Martyn Taylor a écrit :We only support old clients against a new broker. We don't support new clients against old broker. On Fri, Mar 24, 2017 at 1:11 PM, titou10 <[email protected]> wrote: Hi,I have a java client with the Artemis v2.0.0 client jar on the classpath trying to talk to a v1.5.2 server It fails with exception "AMQ214013: Failed to decode packet: java.lang.IllegalArgumentException: AMQ119032: Invalid type: -12" Is this supported, ie v2.0.x jars talking to a v1.5.x server? If so should I open a JIRA? Thanks Denis (Author of JMSToolBox on sourceforge) =================== The code: Session sessionJMS = ... Queue managementQueue = ActiveMQJMSClient.createQueue( "activemq.management"); QueueRequestor requestorJMS = new QueueRequestor((QueueSession) sessionJMS, managementQueue); //->fails here The client side exception : 08:58:25,727 ERROR [org.apache.activemq.artemis.core.client] AMQ214013: Failed to decode packet: java.lang.IllegalArgumentException: AMQ119032: Invalid type: -12 at org.apache.activemq.artemis.core.protocol.core.impl.PacketDe coder.decode(PacketDecoder.java:424) [artemis-core-client-1.5.2.jar :1.5.2] at org.apache.activemq.artemis.core.protocol.ClientPacketDecode r.decode(ClientPacketDecoder.java:60) [artemis-core-client-1.5.2.jar :1.5.2] at org.apache.activemq.artemis.core.protocol.ServerPacketDecode r.decode(ServerPacketDecoder.java:202) [artemis-server-1.5.2.jar:1.5.2] at org.apache.activemq.artemis.core.protocol.core.impl.Remoting ConnectionImpl.bufferReceived(RemotingConnectionImpl.java:349) [artemis-core-client-1.5.2.jar:1.5.2] at org.apache.activemq.artemis.core.remoting.server.impl.Remoti ngServiceImpl$DelegatingBufferHandler.bufferReceived(Remotin gServiceImpl.java:621) [artemis-server-1.5.2.jar:1.5.2] at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveM QChannelHandler.channelRead(ActiveMQChannelHandler.java:68) [artemis-core-client-1.5.2.jar:1.5.2] at io.netty.channel.AbstractChannelHandlerContext.invokeChannel Read(AbstractChannelHandlerContext.java:372) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannel Read(AbstractChannelHandlerContext.java:358) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRe ad(AbstractChannelHandlerContext.java:350) [netty-all-4.1.5.Final.jar:4.1 .5.Final] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead( ByteToMessageDecoder.java:293) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(Byte ToMessageDecoder.java:267) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannel Read(AbstractChannelHandlerContext.java:372) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannel Read(AbstractChannelHandlerContext.java:358) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRe ad(AbstractChannelHandlerContext.java:350) [netty-all-4.1.5.Final.jar:4.1 .5.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext. channelRead(DefaultChannelPipeline.java:1334) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannel Read(AbstractChannelHandlerContext.java:372) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannel Read(AbstractChannelHandlerContext.java:358) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(Defa ultChannelPipeline.java:926) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe. read(AbstractNioByteChannel.java:129) [netty-all-4.1.5.Final.jar:4.1 .5.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEven tLoop.java:610) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimiz ed(NioEventLoop.java:551) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEve ntLoop.java:465) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:437) [netty-all-4.1.5.Final.jar:4.1.5.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run( SingleThreadEventExecutor.java:873) [netty-all-4.1.5.Final.jar:4.1 .5.Final] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_121]
