Java Event Bus

182 views
Skip to first unread message

sherifsa...@gmail.com

unread,
Jun 16, 2015, 12:39:06 PM6/16/15
to ddd...@googlegroups.com
Hi guys,

I was wondering if there is an standalone open source event bus library out there. I've come across Axon framework; however, using Axon's event bus forces you to have all your entities extend a parent class in addition to using Axon's repository.

My manager wants something standalone that doesn't force you to use a whole CQRS and ES framework to publish and subscribe events. He isn't interested in Event sourcing, but the idea of firing domain events sounds appealing to him.

As an example I came across Vaughn Vernon's IDDD project on github IDDD_Samples. This is close to what I'm looking for, but I was hoping if there is something that is production ready.

Kijana Woodard

unread,
Jun 16, 2015, 12:43:13 PM6/16/15
to ddd...@googlegroups.com
Rabbit MQ?

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Altair

unread,
Jun 16, 2015, 2:51:16 PM6/16/15
to ddd...@googlegroups.com
Hi all.

I've been using the in-process Axon for a long time and it does not require to extend your entities from a common super class nor using Adon repositories.

In fact, it's working wonderfully as a stand-alone Event Bus.

Please, double-check it.


just to let you know we're also using the Guava Event Bus, but it has strange default queuing behavior not suitable for our logic (we want Events to be dispatched ASAP without queuing them if the bus is still processing a previously dispatched event - ie in the case an Event Handler dispatches another Event -).

HTH,

Oscar 

Rinat Abdullin

unread,
Jun 16, 2015, 2:55:35 PM6/16/15
to ddd...@googlegroups.com

Rinat Abdullin | Writer at Abdullin.com

sherifsa...@gmail.com

unread,
Jun 16, 2015, 6:00:33 PM6/16/15
to ddd...@googlegroups.com
Well I came across this part in Axon framework documentation:

4.2.1. Basic aggregate implementations
AggregateRoot
In Axon, all aggregate roots must implement the AggregateRoot interface. This interface describes the basic operations needed by the Repository to store and publish the generated domain events. However, Axon Framework provides a number of abstract implementations that help you writing your own aggregates.
AbstractAggregateRoot
The AbstractAggregateRoot is a basic implementation that provides a registerEvent(DomainEvent) method that you can call in your business logic method to have an event added to the list of uncommitted events. The AbstractAggregateRoot will keep track of all uncommitted registered events and make sure they are forwarded to the event bus when the aggregate is saved to a repository.

So my entities need to extend a parent class and use a repository for the events to be published. Would it be possible to demonstrate how you were able to use the event bus without the above limitations, please? 

Óscar Bou Bou

unread,
Jun 16, 2015, 7:03:00 PM6/16/15
to ddd...@googlegroups.com
I use a Simple Event Bus as detailed in [1] for synchronous and dispatching in the same thread, without requiring it to be used from an Axon’s Aggregate Root or Repository.

There are further options available for advanced use cases, like the Clustering Event Bus [2], Asynch Event processing [3] and Distributing the Event Bus through AMQP [4].

In order to publish an Event, as said in [5], simply wrap the payload and send it using the “publish” method defined on the EventBus interface, implemented by all them.
Event Handler Subscriptions can be managed through the “subscribe” and “unsubscribe” methods, and also by annotations [6].

HTH,

Oscar



Michael

unread,
Jun 17, 2015, 8:52:10 AM6/17/15
to ddd...@googlegroups.com
I wouldn't use an event bus at all. Take a look at Greg Young's event store - You can store your events there an subscribe to them. No need for any full blown messaging infrastructure. 
Reply all
Reply to author
Forward
0 new messages