1
我在将Artemis REST功能集成到我的项目之一时遇到问题。更确切地说,一切都很好,直到我试图从队列中消费一条消息。artemis休息集成 - 无法使用队列中的消息
我正在按照文档中提到的过程。 API遵循HATEOAS原则,这意味着您基本上可以通过api调用 ,它们将超链接返回到本身不是用来拨打电话的网址。
的方法,包括
- 发布消息
- 创建一个拉资源消耗的消息
- 实际上是通过拉资源消耗消息
正常工作,直到点3.
调用端点导致异常,抱怨t要消费的消息不是正确的类型。这里是堆栈跟踪:
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: ClientMessage must be an HTTP message or an Object message: ClientMessage[messageID=105226700092, durable=true, address=jms.queue.DLQ,userID=560c0246-e52b-11e5-82d3-4b37ae7b5e66,properties=TypedProperties[__AMQ_CID=5475aad0-e52b-11e5-82d3-4b37ae7b5e66,_AMQ_ORIG_ADDRESS=jms.queue.ExpiryQueue,_AMQ_ORIG_MESSAGE_ID=100931732707,_AMQ_ORIG_QUEUE=jms.queue.ExpiryQueue]] type: 3
at org.apache.activemq.artemis.rest.queue.QueueConsumer.pollWithIndex(QueueConsumer.java:190)
at org.apache.activemq.artemis.rest.queue.QueueConsumer.checkIndexAndPoll(QueueConsumer.java:166)
at org.apache.activemq.artemis.rest.queue.QueueConsumer.poll(QueueConsumer.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:138)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:107)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:133)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:107)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:133)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:101)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)
... 32 more
Caused by: java.lang.IllegalArgumentException: ClientMessage must be an HTTP message or an Object message: ClientMessage[messageID=105226700092, durable=true, address=jms.queue.DLQ,userID=560c0246-e52b-11e5-82d3-4b37ae7b5e66,properties=TypedProperties[__AMQ_CID=5475aad0-e52b-11e5-82d3-4b37ae7b5e66,_AMQ_ORIG_ADDRESS=jms.queue.ExpiryQueue,_AMQ_ORIG_MESSAGE_ID=100931732707,_AMQ_ORIG_QUEUE=jms.queue.ExpiryQueue]] type: 3
at org.apache.activemq.artemis.rest.queue.ConsumedMessage.createConsumedMessage(ConsumedMessage.java:63)
at org.apache.activemq.artemis.rest.queue.QueueConsumer.pollWithIndex(QueueConsumer.java:182)
... 48 more
应用一个wildfly 10内运行时,其包括在阿蒂米斯版本1.1.0(ARTEMIS其余版本:1.1.0)。
我试图通过请求传递消息的内容类型。但它似乎没有效果,无论什么类型的供应。
在这一点上,我对这个错误非常无知。希望任何人都能指引我走向正确的方向。
在此先感谢,托马斯。