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

Groovy client - sendMessage - error #1

Open
leosilvadev opened this issue Jan 4, 2016 · 5 comments
Open

Groovy client - sendMessage - error #1

leosilvadev opened this issue Jan 4, 2016 · 5 comments

Comments

@leosilvadev
Copy link

Using the groovy client we face an error:

java.lang.ClassCastException: io.vertx.core.json.JsonObject cannot be cast to java.lang.String
    at org.collokia.vertx.sqs.SqsQueueProducerVerticle$start$1$replyHandler$1.handle(SqsQueueProducerVerticle.kt:33)
    at org.collokia.vertx.sqs.SqsQueueProducerVerticle$start$1$replyHandler$1.handle(SqsQueueProducerVerticle.kt:12)
    at io.vertx.core.eventbus.impl.HandlerRegistration.handleMessage(HandlerRegistration.java:207)
    at io.vertx.core.eventbus.impl.HandlerRegistration.handle(HandlerRegistration.java:201)
    at io.vertx.core.eventbus.impl.EventBusImpl.lambda$deliverToHandler$123(EventBusImpl.java:498)
    at io.vertx.core.eventbus.impl.EventBusImpl$$Lambda$31/378789212.handle(Unknown Source)
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$16(ContextImpl.java:335)
    at io.vertx.core.impl.ContextImpl$$Lambda$7/245765246.run(Unknown Source)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
    at java.lang.Thread.run(Thread.java:745)

I 'fixed' that here, but it's probably not a real fixing (I change the Message to Message at SqsQueueProducerVerticle.kt:33

@leosilvadev leosilvadev changed the title Groovy client - error Groovy client - sendMessage - error Jan 4, 2016
@apatrida
Copy link
Contributor

apatrida commented Jan 4, 2016

thanks, we'll fix it here, and also build this to maven central soon.

@leosilvadev
Copy link
Author

Great! thanks!

@brainoutsource
Copy link
Contributor

That's not an error, it's just that we expect String message body, not JsonObject. Write your json as a String, you can use JsonObject().encode() ot JsonObject.toString() for that.

I should probably write about that in the readme file.

@leosilvadev
Copy link
Author

Yeah, it really doesn't make sense, but the error happens even when I try to call this:

client.sendMessage('Authorizations', 'anystring', {
    println it.result()
})

I am not with my notebook now, but asap I will check the groovy generated code, but probably it's wrapping the messaging in a JsonObject (since I got something like this using a different codec)

@leosilvadev leosilvadev reopened this Jan 5, 2016
@apatrida
Copy link
Contributor

apatrida commented Apr 4, 2018

We could add an override for JsonObject

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

3 participants