question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

intermittent Object reference issue occurring while consuming continously

See original GitHub issue

Description

We are getting the below exception intermittently

System.NullReferenceException: Object reference not set to an instance of an object. at Confluent.Kafka.ConsumeResult`2.get_Value() at

How to reproduce

  1. created two consumer ( running 2 instance ) and subscribed with same topic.
  2. Running both consumers
  3. consuming kafka messages continuously
  4. After sometime both consumer throwing same exception and almost same time

Then i tried with single consumer and got same issue again Checklist

Please provide the following information:

  • A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • Confluent.Kafka nuget version.
  • Apache Kafka version.
  • Client configuration.
  • Operating system.
  • Provide logs (with “debug” : “…” as necessary in configuration).
  • Provide broker log excerpts.
  • Critical issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mhowlettcommented, May 20, 2020

furthering this, we’ve depreciated convenience methods on ConsumeResult in v1.4.0 and later, and they’ll be removed in 2.0.

0reactions
mhowlettcommented, Jan 22, 2020

@AndrewGumenyuk - yep. the history here is that at one point, the API was such that it wasn’t possible for Message to be null, and this is a hang over from that. The pass-through properties on ConsumeResult just exist as a convenience. This is confusing a lot of people, so I’m becoming more inclined to remove the properties on ConsumeResult that just reference properties in Message as you, and others suggest. However we can’t do this until we version it 2.0 since the change is breaking. The timing of that will depend on other clients too as we’ll want to move all the versions together. The downside is it will impact a lot of people, so there’s a tradeoff here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tracking down intermittent 'Object reference not set to an ...
An "Object reference not set to an instance of an object" is clearly a run-time error, not a compile-time error. So what that...
Read more >
object reference not set to an instance of an object error is ...
After removing then re-adding the account, is this happening after adding a new item? The redacted location could be the clue. Frank_Fazio June ......
Read more >
Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >
Reference counting
Whenever a reference is destroyed or overwritten, the reference count of the object it references is decremented, and whenever one is created or...
Read more >
What Is 'Object reference not set to an instance of ...
The “Object reference not set to an instance of an object” error is a common error message in cloud projects. It typically occurs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found