Interface MetricsGateway
- All Superinterfaces:
HasLocalHandlers, Namespaced<MetricsGateway>
- All Known Implementing Classes:
DefaultMetricsGateway
Gateway interface for publishing metrics messages in Fluxzero.
This gateway provides a convenient way to log and transmit application performance data, operational metrics, or
monitoring signals. Metrics messages can be published either as raw payloads or as fully constructed Message
objects. Metadata and delivery guarantees can also be specified.
Metrics are typically not routed for domain logic handling, but can be consumed by local handlers as well as non-local handlers (e.g., for logging or real-time telemetry).
Example usage:
Fluxzero.publishMetrics(new SystemMetrics(...));
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidPublishes a metrics message using default metadata andGuarantee.NONE.default voidPublishes a metrics payload with the specified metadata and aGuarantee.NONEdelivery guarantee.Publishes a metrics message with the specified metadata and delivery guarantee.Methods inherited from interface HasLocalHandlers
hasLocalHandlers, registerHandler, registerHandler, setSelfHandlerFilterMethods inherited from interface Namespaced
forDefaultNamespace, forNamespace
-
Method Details
-
publish
Publishes a metrics message using default metadata andGuarantee.NONE.If the provided value is already a
Message, its payload and metadata will be extracted. Otherwise, it is wrapped in a newMessage.- Parameters:
metrics- the metrics object orMessageto publish
-
publish
Publishes a metrics payload with the specified metadata and aGuarantee.NONEdelivery guarantee.- Parameters:
payload- the payload of the metrics messagemetadata- metadata to attach to the message
-
publish
Publishes a metrics message with the specified metadata and delivery guarantee.This method may complete asynchronously.
- Parameters:
payload- the metrics payloadmetadata- metadata to attach to the messageguarantee- delivery guarantee (e.g.,Guarantee.SENTorGuarantee.STORED)- Returns:
- a
CompletableFuturethat completes when the message is published (or not, depending on the guarantee)
-