0

I have written two verticle one runs a TCPEventBusBridge and another SockJSEventBus. I want to communicate between both. How can I do it in a vertx environment.

android client is talking to the TCPEventBus server and a web client is listening to a SockJSEvent bus server.

user2746732
  • 119
  • 1
  • 9

1 Answers1

1

If the eventbuses are connected then this shouldn't be a problem. The eventbus has one namespace. That means, if you send a message (m) to an address (a) from your webclient and this address (a) is registered in the component (c), which is connected over the TCPEventBusBridge. The message (m) should reach the component (c).

Here is and example with SockJS and 2 clustered vert.x Instances (2 separate JVM). The part of the TCPEventBusBridge is missing, but it can give you an idea how it can work.
https://github.com/floriankammermann/vertx-examples/blob/master/eventbus-chat (Run the Example on two JVM clustered eventbus)

haschibaschi
  • 2,734
  • 23
  • 31
  • agreed but herer chatserver is only one instance and multiple browser tabs use the eventbus here.. which doesnt give an insight to how server side two verticle talk to each other through an event bus. I tried but I am getting hread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 2081 ms, time limit is 2000 error in one verticle .. – user2746732 Mar 30 '17 at 16:28
  • If you start the chat server two times, as described in Run the Example one two JVM clustered eventbus, then you get two instance. – haschibaschi Mar 30 '17 at 20:35