Class DefaultMetricsGateway

java.lang.Object
io.fluxzero.sdk.common.AbstractNamespaced<MetricsGateway>
io.fluxzero.sdk.publishing.DefaultMetricsGateway
All Implemented Interfaces:
Namespaced<MetricsGateway>, MetricsGateway, HasLocalHandlers

public class DefaultMetricsGateway extends AbstractNamespaced<MetricsGateway> implements MetricsGateway
Default implementation of the MetricsGateway interface.

This class delegates all functionality to an underlying GenericGateway instance, enabling the use of metrics gateway methods while leveraging the generic gateway's capabilities.

See Also:
  • Constructor Details

    • DefaultMetricsGateway

      public DefaultMetricsGateway()
  • Method Details

    • publish

      public CompletableFuture<Void> publish(Object payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee)
      Description copied from interface: MetricsGateway
      Publishes a metrics message with the specified metadata and delivery guarantee.

      This method may complete asynchronously.

      Specified by:
      publish in interface MetricsGateway
      Parameters:
      payload - the metrics payload
      metadata - metadata to attach to the message
      guarantee - delivery guarantee (e.g., Guarantee.SENT or Guarantee.STORED)
      Returns:
      a CompletableFuture that completes when the message is published (or not, depending on the guarantee)
    • createForNamespace

      protected MetricsGateway createForNamespace(String namespace)
      Specified by:
      createForNamespace in class AbstractNamespaced<MetricsGateway>
    • forNamespace

      public DefaultMetricsGateway forNamespace(String namespace)
      Description copied from interface: Namespaced
      Returns the resource scoped to the specified namespace. Passing null selects the namespace configured for this application.
      Specified by:
      forNamespace in interface Namespaced<MetricsGateway>
      Overrides:
      forNamespace in class AbstractNamespaced<MetricsGateway>
      Parameters:
      namespace - the namespace to which the returned resource is scoped, or null for the application namespace
      Returns:
      the resource associated with the specified namespace