FroMage / redpipe

Redpipe Web Framework
Apache License 2.0
70 stars 10 forks source link

eventbus - cdi events #8

Closed fiorenzino closed 6 years ago

fiorenzino commented 6 years ago

Should be really interesting the interaction CDI - vertx EventBus:

in the sender: @Inject Event<Message> eventService; .... eventService.fire(areaEvent);

in the receiver: public void onMessage(@Observes AreaEvent areaEvent) {

} translated in vertx: in the sender: vertx.eventBus().publish("event-queue", new JsonObject().put("areaEvent", areaEvent));

in the receiver: EventBus eb = vertx.eventBus(); eb.consumer(DETECTIONS_QUEUE, this::consume);

protected void consume(Message message) { System.out.println(message.body()) }

what do you think about it?

FroMage commented 6 years ago

Isn't it the same as already provided by http://docs.jboss.org/weld/weld-vertx/latest/ ?

fiorenzino commented 6 years ago

ops.. you are right.. sorry!

FroMage commented 6 years ago

np :)