Skip to content

Commit

Permalink
chore: add logs for throubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
ailtonguitar committed Jun 11, 2024
1 parent 2e2c6e4 commit 129b58d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/KafkaFlow/Producers/MessageProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,19 @@ public void Dispose()
_producer?.Dispose();
}

private static void FillContextWithResultMetadata(IMessageContext context, DeliveryResult<byte[], byte[]> result)
private void FillContextWithResultMetadata(IMessageContext context, DeliveryResult<byte[], byte[]> result)
{
var concreteProducerContext = (ProducerContext)context.ProducerContext;
var concreteProducerContext = context.ProducerContext as ProducerContext;

if (concreteProducerContext is null)
{
_logHandler.Warning("Producer context is null on FillContextWithResultMetadata", new
{
DeliveryResult = result,
});

return;
}

concreteProducerContext.Offset = result.Offset;
concreteProducerContext.Partition = result.Partition;
Expand Down

0 comments on commit 129b58d

Please sign in to comment.