Skip to content
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

Closed
atdi opened this issue Feb 22, 2017 · 6 comments
Closed

ClassCastException when I consume a message #59

atdi opened this issue Feb 22, 2017 · 6 comments
Assignees
Milestone

Comments

@atdi
Copy link

atdi commented Feb 22, 2017

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

  • OS platform and version: Ubuntu 16.04, Java 8
  • Maven package version or commit ID: 0.10.0
@sjkwak
Copy link
Member

sjkwak commented Feb 24, 2017

HI @atdi which library are you using for sending events?

@atdi
Copy link
Author

atdi commented Feb 24, 2017

Not when I send events is the problem and when I consume them.
I used those dependencies:

com.microsoft.azure
azure-eventhubs
0.10.0


com.microsoft.azure
azure-eventhubs-eph
0.10.0

@JamesBirdsall
Copy link
Contributor

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.

@SreeramGarlapati
Copy link
Contributor

@atdi - did you send messages to eventhub with body section as AmqpValue ? Current version of our client has a bug - where it is not compatible with AmqpValue & AmqpSequence. with #66 - it is fixed. pls. see if you can try it and provide any feedback.

@SreeramGarlapati SreeramGarlapati self-assigned this Mar 2, 2017
@SreeramGarlapati
Copy link
Contributor

@atdi - we truly appreciate for filing this interoperability issue. This helped us to 1 up our quality.
This bug has been fixed and is pulled into the current release #82. We are in the process of releasing 0.13.0 - which will include the fix.

@SreeramGarlapati SreeramGarlapati added this to the 0.13.0 milestone Mar 20, 2017
@bearrito
Copy link

bearrito commented Apr 11, 2017

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

'com.microsoft.azure:azure-eventhubs-eph:0.13.0',
'com.microsoft.azure:azure-eventhubs:0.13.0',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants