How to use vert.x eventbus to communicate between openfaas functions

12/13/2021

I am using Vert.x in my openfaas function and I want to communicate between them using vert.x event bus but I am not sure how to use event bus for out side of a function. It works in same function. I didn't find any documentation or resource about this. Currently I am using vertx java11 template for openfaas function but I also want to use python version for ml model and want to communicate between them using event bus. Is it possible in openfaas ?

-- Rakesh
kubernetes
openfaas
vert.x
vertx-eventbus

1 Answer

12/18/2021

If you need to use the eventbus across multiple machines then you need to use a clustered eventbus using any one of the many cluster managers that vert.x supports. When the function comes up it will register it self with the cluster and will be able to communicate with it.

Using the eventbus in a lambda type application will work but seems like a weird pattern. You may want to consider other options such as

  1. http request
  2. Redis pub sub
-- Asad Awadia
Source: StackOverflow