Class AsyncApiMockOrchestrator

java.lang.Object
org.mockserver.async.AsyncApiMockOrchestrator

public class AsyncApiMockOrchestrator extends Object
Orchestrates publishing of example messages derived from an AsyncAPI spec to a message broker via a MessagePublisher.

Supports one-shot publishing (publishAll()) and scheduled periodic publishing (startPublishing(long) / stop()).

When a message defines a correlationId.location, the orchestrator generates a unique correlation ID at publish time and injects it at the specified location (header or payload JSON Pointer).

  • Constructor Details

  • Method Details

    • publishAll

      public void publishAll()
      Publish the generated example message for each message in each channel, threading any AsyncAPI bindings (MQTT qos/retain, Kafka key) and correlation IDs as PublishOptions.

      Multi-message channels (v3 multiple messages, v2 oneOf) result in one publish call per message. Single-message channels behave identically to the previous single-publish behavior.

    • startPublishing

      public void startPublishing(long intervalMillis)
      Start periodic publishing at the given interval.
      Parameters:
      intervalMillis - the interval between publish cycles in milliseconds
    • stop

      public void stop()
      Stop periodic publishing.