TCP EventBus Bridge

527 views
Skip to first unread message

Marty Kube

unread,
Apr 14, 2016, 7:10:53 PM4/14/16
to vert.x
Hi,

I'm working on a client that connects to the TCP event bus bridge (version 3.2.1).  I'm running into an issue when I try to register.  The client send this JSON over the bridge to the vertx instance:

{"body": {}, "headers": {}, "type": "register", "address": "status"}

And I see the following exception on the console for vertx instance that received the message:

Apr 14, 2016 6:58:15 PM io.vertx.core.eventbus.impl.HandlerRegistration
SEVERE: Failed to handleMessage
java.lang.ClassCastException: java.lang.String cannot be cast to io.vertx.core.json.JsonObject
    at io.vertx.ext.eventbus.bridge.tcp.impl.TcpEventBusBridgeImpl.lambda$null$4(TcpEventBusBridgeImpl.java:194)
    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$127(EventBusImpl.java:498)
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:335)
    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've been looking at the TcpEventBusBridgeImpl.  Nothing is jumping out at me yet.

Any suggestions?

Thanks

Marty Kube

unread,
Apr 14, 2016, 8:57:09 PM4/14/16
to vert.x
So, I was trying to put together a minimal example...  Which seemed to work fine.

I think issue is probably my code in the vertx instance.  I'm looking into it.

Marty Kube

unread,
Apr 15, 2016, 9:03:57 AM4/15/16
to vert.x
Well, I was able to reproduce the issue.  I have minimal example of the problem here:

https://github.com/martykube/Vertx-TCP-Event-Bus-Bridge-Example

Paulo Lopes

unread,
Apr 15, 2016, 10:45:38 AM4/15/16
to vert.x
Thanks i'll have a look.

Jayamine A.

unread,
May 21, 2016, 2:56:46 PM5/21/16
to vert.x

Json messages should be encoded in "utf-8".

I'm not very sure. But try to encode json string before sending.

Sergio Toro Escofet

unread,
Jan 4, 2017, 12:05:22 PM1/4/17
to vert.x
Hello!!! can i have an eventbus instance in the client and use it for send message throught the tcp-vertx-tcp-eventbu-bridge. I have two apps and boths use vertx, i like entablish an eventbus conmunication between them like VertxCluster but VertxCluster is big for the purpose of this apps. Thanks

Julien Viet

unread,
Jan 4, 2017, 4:21:33 PM1/4/17
to ve...@googlegroups.com
it seems this issue is the feature you would like to be implemented : https://github.com/vert-x3/issues/issues/150

Julien

On Jan 4, 2017, at 6:05 PM, Sergio Toro Escofet <storo...@gmail.com> wrote:

Hello!!! can i have an eventbus instance in the client and use it for send message throught the tcp-vertx-tcp-eventbu-bridge. I have two apps and boths use vertx, i like entablish an eventbus conmunication between them like VertxCluster but VertxCluster is big for the purpose of this apps. Thanks

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/7e27723c-8d2d-4fa6-8b2e-59539af34452%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mumuney Abdlquadri

unread,
Jan 4, 2017, 10:40:27 PM1/4/17
to ve...@googlegroups.com
Hello Julien,

From your comment could it be that this https://github.com/abdlquadri/vertx-eventbus-java will work for Sergio's scenario.

We actually use it in an android app.

Thanks.



On Wed, Jan 4, 2017 at 10:21 PM, Julien Viet <jul...@julienviet.com> wrote:
it seems this issue is the feature you would like to be implemented : https://github.com/vert-x3/issues/issues/150

Julien


On Jan 4, 2017, at 6:05 PM, Sergio Toro Escofet <storo...@gmail.com> wrote:

Hello!!! can i have an eventbus instance in the client and use it for send message throught the tcp-vertx-tcp-eventbu-bridge. I have two apps and boths use vertx, i like entablish an eventbus conmunication between them like VertxCluster but VertxCluster is big for the purpose of this apps. Thanks

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

Julien Viet

unread,
Jan 5, 2017, 5:02:34 AM1/5/17
to ve...@googlegroups.com
indeed.

it could be used in such scenario, I’ll add it as comment on the github issue as well.

To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages