kafka

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryConnect

func RetryConnect(brokers []string, retryInterval time.Duration) chan sarama.Client

RetryConnect implements a retry mechanism for establishing the Kafka connection. This is necessary in container environments where individual components may be started out-of-order, so we might have to wait for upstream services like Kafka to actually become available.

Alternatives:

  • use an entrypoint script in your container in which you wait for the service to be available [1]
  • use a script like wait-for-it [2] in your entrypoint

[1] http://stackoverflow.com/q/25503412/1995300 [1] https://github.com/vishnubob/wait-for-it/blob/master/wait-for-it.sh

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL