confluent-kafka-dotnet icon indicating copy to clipboard operation
confluent-kafka-dotnet copied to clipboard

Getting Exeception not consuming

Open roshanmt opened this issue 2 years ago • 3 comments

Beacause of what issue this error is coming

=========== System.OperationCanceledException: The operation was canceled. at System.Threading.CancellationToken.ThrowOperationCanceledException() at Confluent.Kafka.Consumer`2.Consume(CancellationToken cancellationToken) at PublicPagesImpactSyncService.Service.ImpactMetricsSinkService.<>c__DisplayClass9_0.<<ExecuteAsync>b__0>d.MoveNext() in ImpactMetricsSinkService.cs:line 68

================

roshanmt avatar Nov 24 '22 10:11 roshanmt

Please use stackoverflow to get a quicker response to usage questions like this. However, it's important to provide much more context (code, stuff you are doing, stuff you've tried) there too - you'll have a much better chance of getting help if you meet people half way as opposed to leaving them guessing.

bartelink avatar Nov 25 '22 00:11 bartelink

If this is still an issue, please provide more details and debug logs.

anchitj avatar Feb 27 '24 12:02 anchitj

@roshanmt I see you are using the CancellationToken in the consume method.

I am assuming there might be a code where it's cancelling the Token in the different thread in your code. The same code is passed in your Consume method which leads to Throwing the OperationCancellationException.

ksdvishnukumar avatar May 06 '24 01:05 ksdvishnukumar