Closed fiorenzino closed 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?
Isn't it the same as already provided by http://docs.jboss.org/weld/weld-vertx/latest/ ?
ops.. you are right.. sorry!
np :)
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?