java.lang.Object
org.axonframework.extension.reactor.messaging.eventhandling.gateway.DefaultReactorEventGateway
All Implemented Interfaces:
DescribableComponent, ReactorEventGateway

public class DefaultReactorEventGateway extends Object implements ReactorEventGateway
Default implementation of ReactorEventGateway.

Builds a recursive interceptor chain that runs inside the Reactor subscription, then delegates to the Axon Framework EventGateway.

Each event payload is converted to an EventMessage, run through the interceptor chain (which may enrich metadata), and then passed to the delegate gateway. Since EventGateway.publish(List) preserves objects that are already EventMessage instances, the enriched metadata is retained.

Since:
4.4.2
Author:
Milan Savic, Theo Emanuelsson
See Also:
  • Constructor Details

  • Method Details

    • publish

      public reactor.core.publisher.Mono<Void> publish(@Nullable ProcessingContext context, List<?> events)
      Description copied from interface: ReactorEventGateway
      Publishes the given list of events within the given context (if available) and returns a Mono that completes when publishing is done.
      Specified by:
      publish in interface ReactorEventGateway
      Parameters:
      context - the processing context, if any, to publish the given events in
      events - the events to publish
      Returns:
      a Mono completing when the events have been published
    • describeTo

      public void describeTo(ComponentDescriptor descriptor)
      Description copied from interface: DescribableComponent
      Describe the properties of this DescribableComponent with the given descriptor.

      Components should call the appropriate describeProperty methods on the descriptor to register their properties. The descriptor is responsible for determining how these properties are formatted and structured in the final output.

      Best Practices: As a general rule, all relevant fields of a DescribableComponent implementation should be described in this method. However, developers have discretion to include only the fields that make sense in the context. Not every field may be meaningful for description purposes, especially internal implementation details. Furthermore, components might want to expose different information based on their current state. The final decision on what properties to include lies with the person implementing the describeTo method, who should focus on providing information that is useful for understanding the component's configuration and state.

      Example implementation:

       public void describeTo(ComponentDescriptor descriptor) {
           descriptor.describeProperty("name", this.name);
           descriptor.describeProperty("enabled", this.enabled);
           descriptor.describeProperty("configuration", this.configuration); // A nested component
           descriptor.describeProperty("handlers", this.eventHandlers);      // A collection
       }
       
      Specified by:
      describeTo in interface DescribableComponent
      Parameters:
      descriptor - The component descriptor to describe this DescribableComponentn its properties in.