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

DE14689 add support to reconnect kafka cluster admin #187

Closed
wants to merge 7 commits into from

Conversation

stonedu1011
Copy link
Contributor

xinzlu Authored by xinzlu
Apr 28, 2022
Merged Apr 29, 2022


fix DE14689 sarama cluster admin lost kafka connection after 10 min.

unable to create topic xxx: write tcp 10.201.187.47:56742->10.201.187.10:9093: write: broken pipe
  1. Exposed kafka.metadata.refresh-frequency: 300s for sarama kafka client's built in backgroundMetadataUpdater task (client.conf.Metadata.RefreshFrequency) as mentioned in: producer write broken pipe IBM/sarama#1565
  2. For webhookservice, dynamic topic creation is used and sarama's built in backgroundMetadataUpdater task cannot keep the kafka connection alive for ClusterAdmin(ClusterAdmin uses different broker connection from the ones used in backgroundMetadataUpdater ). As a workaround ReloadClusterAdmin has been added so service can recreate ClusterAdmin instance when the connection is broken/lost.
  3. Added CloseProducer to close dynamic producers created in webhook service to reduce resource usage.
  4. Use service name as kafka client id.

@stonedu1011
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants