-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClassCastException when I consume a message #59
Comments
HI @atdi which library are you using for sending events? |
Not when I send events is the problem and when I consume them. |
We ask about the sender because this looks like compatibility issues that we have seen before, where the sender formats the body of the message in an AMQP type that our receiver is not prepared to handle. Some senders can prepare a message in a variety of ways and the easiest way to get this working may be to change an option on the sender. |
I am seeing similar behavior. I am using the QPID Proton to send. What is the proper way to consume an AMQP message from Java? I can see amqpBody is not null in my EventData instance, but the call to getBytes() returns null. My gradle has the following
|
Actual Behavior
java.lang.ClassCastException: org.apache.qpid.proton.amqp.messaging.AmqpValue cannot be cast to org.apache.qpid.proton.amqp.messaging.Data
at com.microsoft.azure.eventhubs.EventData.(EventData.java:85) ~[azure-eventhubs-0.10.0.jar:na]
at com.microsoft.azure.eventhubs.EventDataUtil.toEventDataCollection(EventDataUtil.java:46) ~[azure-eventhubs-0.10.0.jar:na]
at com.microsoft.azure.eventhubs.PartitionReceiver$3.apply(PartitionReceiver.java:291) ~[azure-eventhubs-0.10.0.jar:na]
at com.microsoft.azure.eventhubs.PartitionReceiver$3.apply(PartitionReceiver.java:287) ~[azure-eventhubs-0.10.0.jar:na]
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) ~[na:1.8.0_111]
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) ~[na:1.8.0_111]
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) ~[na:1.8.0_111]
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962) ~[na:1.8.0_111]
at com.microsoft.azure.servicebus.MessageReceiver.onReceiveComplete(MessageReceiver.java:401) ~[azure-eventhubs-0.10.0.jar:na]
at com.microsoft.azure.servicebus.amqp.ReceiveLinkHandler.onDelivery(ReceiveLinkHandler.java:99) ~[azure-eventhubs-0.10.0.jar:na]
at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:185) ~[proton-j-0.14.0.jar:na]
at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) ~[proton-j-0.14.0.jar:na]
at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:309) ~[proton-j-0.14.0.jar:na]
at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276) ~[proton-j-0.14.0.jar:na]
at com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:409) ~[azure-eventhubs-0.10.0.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
Expected Behavior
To receive the message
Versions
The text was updated successfully, but these errors were encountered: