Description
Hi,
I'm using the AddOutboundEndpointsCheck method and noticed that ping messages are being received from all consumers...
The expected result should be that no consumer receives the ping message, how can we do that?
Code:
services.AddHealthChecks() .AddConsumersCheck() .AddOutboundEndpointsCheck() .AddOutboxCheck();
There are two situations:
1 - Using .AddInbound<T>
, the ping message is received in the consumer without errors in all consumers, because it tries to serialize the ping message as if it were from the consumer
2 - Using .AddInbound(...)
, an error is generated:
Processing inbound message. | endpointName: order-events, messageType: Silverback.Messaging.HealthChecks.PingMessage, Silverback.Integration, Version=3.8.0.0, Culture=neutral, PublicKeyToken=null, messageId: 03f4917a-8a4c-44dc-a0d9-43068d9736ea, offset: [0]@57, kafkaKey: 03f4917a-8a4c-44dc-a0d9-43068d9736ea
fail: Silverback.Messaging.Inbound.Transaction.TransactionHandlerConsumerBehavior[1002]
Error occurred processing the inbound message. | endpointName: order-events, messageType: Silverback.Messaging.HealthChecks.PingMessage, Silverback.Integration, Version=3.8.0.0, Culture=neutral, PublicKeyToken=null, messageId: 03f4917a-8a4c-44dc-a0d9-43068d9736ea, offset: [0]@57, kafkaKey: 03f4917a-8a4c-44dc-a0d9-43068d9736ea
Silverback.Messaging.Publishing.UnhandledMessageException: No subscriber could be found to handle the message of type Silverback.Messaging.Messages.InboundEnvelope`1[[Silverback.Messaging.HealthChecks.PingMessage, Silverback.Integration, Version=3.8.0.0, Culture=neutral, PublicKeyToken=null]].
at Silverback.Messaging.Publishing.Publisher.PublishCoreAsync(Object message, Boolean throwIfUnhandled, Boolean executeAsync)
at Silverback.Messaging.Outbound.Routing.OutboundRouterBehavior.HandleAsync(Object message, MessageHandler next)
at Silverback.Messaging.Outbound.Routing.ProduceBehavior.HandleAsync(Object message, MessageHandler next)
at Silverback.Messaging.Inbound.PublisherConsumerBehavior.PublishEnvelopeAsync(ConsumerPipelineContext context, Boolean throwIfUnhandled)
at Silverback.Messaging.Inbound.PublisherConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Sequences.SequencerConsumerBehaviorBase.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Sequences.SequencerConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Headers.HeadersReaderConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Validation.ValidatorConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Serialization.DeserializerConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.BinaryFiles.BinaryFileHandlerConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Encryption.DecryptorConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Inbound.ExactlyOnce.ExactlyOnceGuardConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Sequences.SequencerConsumerBehaviorBase.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)
at Silverback.Messaging.Inbound.Transaction.TransactionHandlerConsumerBehavior.HandleAsync(ConsumerPipelineContext context, ConsumerBehaviorHandler next)