Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
Consumer is a wrapper for kafka.Consumer
func NewConsumer ¶
NewConsumer is a constructor for wrapper Consumer.
func (*Consumer) AsyncConsumeWithSpan ¶
func (c *Consumer) AsyncConsumeWithSpan(ctx context.Context, callback MessageCallback, errCallback ErrorCallBack)
AsyncConsumeWithSpan triggers the ConsumeWithSpan with goroutine. Note that input context does not have affect on loop. It is just used for Opentracing
func (*Consumer) ConsumeWithSpan ¶
func (c *Consumer) ConsumeWithSpan(ctx context.Context, callback MessageCallback, errCallback ErrorCallBack)
ConsumeWithSpan consumes the kafka bus also extract the span values Note that input context does not have affect on loop. It is just used for Opentracing
type ErrorCallBack ¶
ErrorCallBack is a callback method for error handling. If kafka sends a error this method will be called. error returns the error that occured in kafka. bool value show the if the kafka listen loop is closed.
type MessageCallback ¶
MessageCallback is a callback method for receiving kafka messages. Span subsequent reference can be extracted from context
type Producer ¶
Producer is a wrapper for Kafka.Producer.
func NewProducer ¶
NewProducer creates a Producer. If trace is not null, trace will be usable. It uses kafka.NewProducer under the hood to initiate producer configuration.