Platform Explorer / Nuxeo Platform 2023.12

Component org.nuxeo.ecm.core.event.EventServiceComponent


Event service

Resolution Order

The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

10 (Declared Start Order: -500)
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.


Class: org.nuxeo.ecm.core.event.EventServiceComponent


Extension Points


XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.core.event.EventServiceComponent" version="1.0">
    Event service

  <implementation class="org.nuxeo.ecm.core.event.EventServiceComponent"/>

    <provide interface="org.nuxeo.ecm.core.event.EventService"/>
    <provide interface="org.nuxeo.ecm.core.event.EventProducer"/>
    <provide interface="org.nuxeo.ecm.core.event.EventServiceAdmin"/>

  <extension-point name="listener">
      Extension point defining event listeners.

      An event listener describes some Java code that can be executed
      synchronously or asynchronously when an event is fired by Nuxeo code.

      Example listener:
        <listener name="mylistener" enabled="true"
            postCommit="false" async="false"
            priority="50" retryCount="1">

      The events listed are those for which the listener will be called.
      If there are none, the listener is called for all events, but this is strongly
      discouraged for performance reasons.

      Listeners belong to one of three categories:

      If postCommit=false then the listener is purely synchronous
      (also called "inline") and executed in the same thread and transaction
      as the code firing the event, as a regular method call.
      The class must implement org.nuxeo.ecm.core.event.EventListener,
      which receives events one at a time.

      If postCommit=true and async=true then the listener is purely
      asynchronous and executed at an arbitrary later point in time
      (but after the original transaction is committed), in its own thread and transaction.
      It may be retried if a ConcurrentUpdateException is detected.
      The listener is executed asynchronously by the WorkManager via a Work instance
      whose category (which determines the Work queue used) is the listener's name.
      The class must implement org.nuxeo.ecm.core.event.PostCommitEventListener,
      which receives a bundle of all the events raised by the original transaction.

      If postCommit=true and async=false then the listener is executed synchronously
      immediately after the original transaction is committed, but in a separate transaction.
      It is not executed if the original transaction does a rollback.
      All listeners in this category are executed one after the other (in priority order),
      and only after they are all done does the main thread continue execution.
      (However if one of the listeners takes too long it is left to run purely asynchronously
      and the other listeners in this category are processed.)
      The class must implement org.nuxeo.ecm.core.event.PostCommitEventListener,
      which receives a bundle of all the events raised by the original transaction.

      The priority gives a global ordering of all the listeners
      in the same category executed for a given event.
      The default is 0.

      The retryCount specifies how many times a purely asynchronous listener
      may retry execution if it resulted in a ConcurrentUpdateException.
      The default is 1.
    <object class="org.nuxeo.ecm.core.event.impl.EventListenerDescriptor"/>

  <extension-point name="pipe">
      Extension point to contribute event pipe.

      An event pipe is a where Nuxeo events will be sent for asynchronous processing.

      Example pipe definition:
        <eventPipe name="dummyPipe1" class="org.nuxeo.ecm.core.event.pipe.DummyPipe" priority="0">
	        <parameter name="foo">bar</parameter>
    <object class="org.nuxeo.ecm.core.event.pipe.EventPipeDescriptor"/>

  <extension-point name="dispatcher">
      Extension point to define the dispatcher used to dispatch event between pipes.

      Example dispatcher definition:
        <eventDispatcher name="dispatcher"
             <parameter name="foo">bar</parameter>
    <object class="org.nuxeo.ecm.core.event.pipe.dispatch.EventDispatcherDescriptor"/>

  <extension-point name="domainEventProducer">
      Extension point to define Stream Domain Event Producers.
    <object class=""/>

  <extension target="org.nuxeo.ecm.core.event.EventServiceComponent" point="listener">
    <listener name="domainEventListener" async="false" priority="500"