using mod-redis pubsub, does it make the eventbus work across machines?

369 views
Skip to first unread message

Joseph Fouad

unread,
Sep 25, 2013, 10:38:42 AM9/25/13
to ve...@googlegroups.com
Hi all
I am new here, so please be patient :)

I am trying to use vertx as the core of a group communication project
it may require more than one machine, so the question is :
if i used the mod-redis, will this make me able to publish on the event bus on one machine, and recieve on a subscribing verticle on another machine
i.e. does mod-redis makes the eventbus work across machines?

thanks a lot

Tim Fox

unread,
Sep 25, 2013, 10:42:46 AM9/25/13
to ve...@googlegroups.com
The event bus does not use mod-redis at all. mod-redis is a module for
communication with redis server(s).

The event bus works between different machines, and can even extend to
client side JavaScript so yes you can do what you want.

I recommend taking a look at the docs, there is plenty of information on
what the event bus is and how it works there. There are also various
event bus examples in both the docs and in the examples repository.

Hope that helps :)

Joseph Fouad

unread,
Sep 25, 2013, 5:12:49 PM9/25/13
to ve...@googlegroups.com
Hi dear Tim and thanks for the reply

Sorry if i could not make the question more clear
I understand that the eventbus does not use mod-redis
but as far as i know, the mod-redis (being a module) is using the event bus to send and recieve messages
so, if i use the redis pubsub capability, i assume that i can publish from one machine and subscribe on the other
but as i send the commands to redis through the eventbus, then the flow will be:
publish to redis through eventbus on machine a -> redis -> get the message through eventbus on machine b
Is this correct
Thanks a lot

Joe

Tim Fox

unread,
Sep 26, 2013, 3:03:04 AM9/26/13
to ve...@googlegroups.com
On 25/09/13 22:12, Joseph Fouad wrote:
> Hi dear Tim and thanks for the reply
>
> Sorry if i could not make the question more clear
> I understand that the eventbus does not use mod-redis
> but as far as i know, the mod-redis (being a module) is using the event bus
> to send and recieve messages
> so, if i use the redis pubsub capability, i assume that i can publish from
> one machine and subscribe on the other

Yes you could do pub/sub via redis if you want. But the Vert.x event bus
already supports pub/sub without redis, so I'm not sure why you would
want to do that.

Paulo Lopes

unread,
Sep 26, 2013, 3:43:45 AM9/26/13
to ve...@googlegroups.com
Hi there, you need to understand that redis pub/sub and vert.x eventbus are 2 distinct components. Although it is common to use redis pub/sub to create a a message bus, vert.x does not uses this, it has its own bus.

Imagine the scenario where you have multiple verticles (see a verticle as a worker process), each verticle does a task in your application, in order to then to communicate, they use vert.x eventbus, now imagine that you need to communicate with another application that for example runs on another platform. One possible solution here is to use redis pub/sub between the two platforms vert.x and say for example node.js.

So while your verticle communicate internally using vert.x event bus, between platforms verticles communicate to node.js using redis, now the probably not so obvious thing is that since all verticles do not know anything about redis, (they only know about a module mod-redis) they send messages to the vert.x eventbus for the mod-redis execute on redis and the module, will reply to the verticle what redis replies.

I hope this makes it clear...
Reply all
Reply to author
Forward
0 new messages