Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error handling for SubscribeTopics function call in consumer_example.go #1167

Open
7 tasks
Vrashabh-Sontakke opened this issue Apr 5, 2024 · 0 comments · May be fixed by #1169
Open
7 tasks

Add error handling for SubscribeTopics function call in consumer_example.go #1167

Vrashabh-Sontakke opened this issue Apr 5, 2024 · 0 comments · May be fixed by #1169

Comments

@Vrashabh-Sontakke
Copy link

Vrashabh-Sontakke commented Apr 5, 2024

Description

Currently, the consumer_example.go file lacks error handling for the SubscribeTopics function call. This makes the application vulnerable to potential failures during topic subscription. To ensure robustness and proper error handling, we need to add error checking and handling for this function call.

err = c.SubscribeTopics(topics, nil)

How to reproduce

N/A

Proposed Solution

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

Add error handling logic after the SubscribeTopics function call in the main function of consumer_example.go. Specifically, check for errors returned by the function call and exit the program with an error message if subscription fails.

Additional Information

This issue is critical for ensuring the reliability of the Kafka consumer application. Proper error handling during topic subscription is essential for smooth operation in production environments.

Checklist

Please provide the following information:

  • confluent-kafka-go and librdkafka version (LibraryVersion()):
  • Apache Kafka broker version:
  • Client configuration: ConfigMap{...}
  • Operating system:
  • Provide client logs (with "debug": ".." as necessary)
  • Provide broker log excerpts
  • Critical issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant