Class LoggerMessagingExtensions
- Namespace
- Stratara.Shared.Diagnostics.Extensions
- Assembly
- Stratara.Outbox.RabbitMQ.dll
Source-generated ILogger extension methods for the Stratara messaging stack
(RabbitMQ / Azure Service Bus dispatch and consumption). Event-IDs are defined in
LogEvents.Messaging.
public static class LoggerMessagingExtensions
- Inheritance
-
LoggerMessagingExtensions
- Inherited Members
Methods
LogCommandEnvelopeDispatchFailed(ILogger, string, Exception)
Logs that a direct publish of a CommandEnvelope failed. The dispatcher will fall back
to storing the envelope in the outbox table and rely on Stratara.Outbox.RabbitMQ.Outbox.OutboxWorker
to retry the publish.
[LoggerMessage(EventId = 108103, Level = LogLevel.Warning, Message = "Error publishing command to topic {Topic}. Will store in outbox.")]
public static void LogCommandEnvelopeDispatchFailed(this ILogger logger, string topic, Exception exception)
Parameters
loggerILoggerThe logger.
topicstringThe command topic that failed.
exceptionExceptionThe exception raised by the message-bus client.
LogConcurrencyConflictRequeued(ILogger, Guid, string)
Logs that a write-side concurrency conflict was detected while applying a command;
the message has been NACKed with requeue=true for a retry against the new aggregate version.
[LoggerMessage(EventId = 108105, Level = LogLevel.Information, Message = "Concurrency conflict on stream {StreamId} ({AggregateTypeName}); message requeued for retry.")]
public static void LogConcurrencyConflictRequeued(this ILogger logger, Guid streamId, string aggregateTypeName)
Parameters
loggerILoggerThe logger.
streamIdGuidThe aggregate stream that conflicted.
aggregateTypeNamestringCLR type name of the aggregate.
LogEventBundleDispatchFailed(ILogger, string, Exception)
Logs that a direct publish of an EventBundle failed. The dispatcher will fall back
to storing the bundle in the outbox table and rely on Stratara.Outbox.RabbitMQ.Outbox.OutboxWorker
to retry the publish.
[LoggerMessage(EventId = 108104, Level = LogLevel.Warning, Message = "Error publishing event bundle to topic {Topic}. Will store in outbox.")]
public static void LogEventBundleDispatchFailed(this ILogger logger, string topic, Exception exception)
Parameters
loggerILoggerThe logger.
topicstringThe event-bundle topic that failed.
exceptionExceptionThe exception raised by the message-bus client.
LogMessageDeserializationFailed(ILogger, string, Exception)
Logs that a message body could not be deserialized into the expected payload type.
[LoggerMessage(EventId = 108102, Level = LogLevel.Error, Message = "Error deserialize message from topic {Topic}")]
public static void LogMessageDeserializationFailed(this ILogger logger, string topic, Exception exception)
Parameters
loggerILoggerThe logger.
topicstringThe topic / queue / exchange the message originated from.
exceptionExceptionThe deserialization exception.
LogMessageProcessingFailed(ILogger, string, Exception)
Logs that a message could not be processed by a subscription handler.
[LoggerMessage(EventId = 108101, Level = LogLevel.Error, Message = "Error processing message from topic {Topic}")]
public static void LogMessageProcessingFailed(this ILogger logger, string topic, Exception exception)
Parameters
loggerILoggerThe logger.
topicstringThe topic / queue / exchange the message originated from.
exceptionExceptionThe exception raised by the handler or by the deserializer.
LogPublishChannelCleanupFailed(ILogger, Exception)
Logs that disposing the publish channel / connection before a recreate failed; the recreate proceeds anyway.
[LoggerMessage(EventId = 108109, Level = LogLevel.Warning, Message = "Error disposing RabbitMQ publish channel / connection before re-create; continuing.")]
public static void LogPublishChannelCleanupFailed(this ILogger logger, Exception exception)
Parameters
LogRabbitMqGuestFallback(ILogger, string)
Warns that the bus is falling back to the default RabbitMQ guest/guest credentials.
[LoggerMessage(EventId = 108108, Level = LogLevel.Warning, Message = "RABBITMQ_USERNAME / RABBITMQ_PASSWORD not set — falling back to default guest credentials for host {Host}. Production hosts must set both.")]
public static void LogRabbitMqGuestFallback(this ILogger logger, string host)
Parameters
LogSubscriptionCleanup(ILogger, string)
Logs that the RabbitMQ subscription is shutting down (cancellation requested).
[LoggerMessage(EventId = 108006, Level = LogLevel.Information, Message = "Cleaning up RabbitMQ subscription {Subscription}.")]
public static void LogSubscriptionCleanup(this ILogger logger, string subscription)
Parameters
LogSubscriptionCleanupFailed(ILogger, string, Exception)
Logs that the RabbitMQ subscription cleanup did not succeed cleanly.
[LoggerMessage(EventId = 108107, Level = LogLevel.Warning, Message = "Error during RabbitMQ subscription cleanup for {Subscription}.")]
public static void LogSubscriptionCleanupFailed(this ILogger logger, string subscription, Exception exception)