Events

Events are meant for exchanging information between loosely coupled components. Hybris event system is based on the spring event framework. Hybris events allow us to publish and listen to specific events for perform business logic depending on the event that occured. Events can be published either locally or across cluster nodes.

Events are good to use when we want to pass on the processing to another thread. we use event for less priority task or long time running task or something which can be done in parallel by separated thread from the main thread. For example triggering of email, sending report to third party server, adding logs etc.

Events Mechanism

Let’s see how we can create, publish custom events and how to create event listener.