activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From titou10 titou10 <titou10.tito...@gmail.com>
Subject Artemis 2.0: How to get the list of Queues and Topics from a server? (Fails in 2.0 with v1.5.3 code)
Date Wed, 22 Mar 2017 18:01:31 GMT
Hi,
With Artemis v1.5.3, to retrieve the list of queues and topics, I was
using this code (inspired from the example)

Queue managementQueue = ActiveMQJMSClient.createQueue("activemq.management");
Session sessionJMS = jmsConnection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
QueueRequestor requestorJMS = new QueueRequestor((QueueSession)
sessionJMS, managementQueue);
Message m = sessionJMS.createMessage();
JMSManagementHelper.putAttribute(m, ResourceNames.JMS_SERVER,
"queueNames"); // "topicNames" for topics
Message r = requestorJMS.request(m);
Object q = JMSManagementHelper.getResult(r);
...

If I run this code from a client with the v1.5.3 jars to a v2.0.0 server I got:
An exception on the server:

Caused by: java.lang.IllegalArgumentException: AMQ119067: Cannot find
resource with name jms.server
        at org.apache.activemq.artemis.core.server.management.impl.ManagementServiceImpl.getAttribute(ManagementServiceImpl.java:675)
[artemis-server-2.0.0.jar:2.0.0]
        ... 30 more

And an exception on the client:
java.lang.IndexOutOfBoundsException: readerIndex(22) + length(98)
exceeds writerIndex(116): UnpooledDuplicatedByteBuf(ridx: 22, widx:
116, cap: 451, unwrapped: UnpooledUnsafeHeapByteBuf(ridx: 439, widx:
451, cap: 451))
    at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1395)
    at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.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.ChannelBufferWrapper.readSimpleStringInternal(ChannelBufferWrapper.java:93)
    at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper.readNullableSimpleString(ChannelBufferWrapper.java:73)
    at org.apache.activemq.artemis.api.core.management.ManagementHelper.getResults(ManagementHelper.java:196)
    at org.apache.activemq.artemis.api.core.management.ManagementHelper.getResult(ManagementHelper.java:224)
    at org.apache.activemq.artemis.api.jms.management.JMSManagementHelper.getResult(JMSManagementHelper.java:149)
    at org.apache.activemq.artemis.api.jms.management.JMSManagementHelper.getResult(JMSManagementHelper.java:139)

I tried to update the client jars to v2.0.0. In v1.5.3, the
"ResourceNames.JMS_SERVER" variable exists with value "jms.server", in
v2.0.0, The ResourceName has benne totally changed and no "JMS_SERVER"
variable anymore (and no "SERVER" lookalike variable..).

So the question are
- how to retrieve the list of Queues and Topics from an Artemis v2.0.0 server?
- is there a migration/upgrade guide to upgrade from 1.5.x to 2.0.x?
- or a least is there a list of "deprecated/removed/changed" features
from v1.5.x to 2.0.x?

Thanks

Denis (Author of JMSToolBox on sourceforge)

Mime
View raw message