Documentation ¶
Index ¶
- Variables
- func AddXOriginIfMissing(message *[]sarama.RecordHeader) error
- func AddXTrace(message *[]sarama.RecordHeader, value string) error
- func GetKafkaStats() (send uint64, received uint64)
- func NewConsumerGroupHandler(queue *chan Message) sarama.ConsumerGroupHandler
- type Client
- type ConsumerGroupHandler
- type Message
- type NewClientOptions
- type SenderTag
- type TraceValue
Constants ¶
This section is empty.
Variables ¶
var MicroserviceName, _ = env.GetAsString("MICROSERVICE_NAME", false, "")
var SerialNumber, _ = env.GetAsString("SERIAL_NUMBER", false, "")
Functions ¶
func AddXOriginIfMissing ¶ added in v1.4.0
func AddXOriginIfMissing(message *[]sarama.RecordHeader) error
func GetKafkaStats ¶ added in v1.2.3
func NewConsumerGroupHandler ¶
func NewConsumerGroupHandler(queue *chan Message) sarama.ConsumerGroupHandler
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewKafkaClient ¶
func NewKafkaClient(opts NewClientOptions) (client *Client, err error)
func (*Client) ChangeSubscribedTopics ¶
func (*Client) EnqueueMessage ¶
func (*Client) GetMessages ¶
func (*Client) TopicCreator ¶ added in v1.3.1
type ConsumerGroupHandler ¶
type ConsumerGroupHandler struct {
// contains filtered or unexported fields
}
func (ConsumerGroupHandler) Cleanup ¶
func (c ConsumerGroupHandler) Cleanup(session sarama.ConsumerGroupSession) error
func (ConsumerGroupHandler) ConsumeClaim ¶
func (c ConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
func (ConsumerGroupHandler) Setup ¶
func (c ConsumerGroupHandler) Setup(session sarama.ConsumerGroupSession) error
type Message ¶ added in v1.2.0
func ToKafkaMessage ¶
type NewClientOptions ¶
type NewClientOptions struct { ListenTopicRegex *regexp.Regexp SenderTag SenderTag ConsumerName string Brokers []string StartOffset int64 Partitions int32 ReplicationFactor int16 EnableTLS bool ClientID string }
NewClientOptions are the options for creating a new kafka client. ListenTopicRegex is the regex to match topics to listen to. ConsumerName is the name of the consumer group (group.id). Brokers is the list of brokers to connect to. StartOffset is the offset to start consuming from. Partitions is the number of partitions to create for new topics. ReplicationFactor is the replication factor to use for new topics. EnableTLS enables TLS for the connection. SenderTag controls the sender tagging feature. ClientID is the client ID to use for the connection, only relevant for debugging.
type SenderTag ¶ added in v1.4.0
type SenderTag struct { OverwriteSerialNumber *string OverwriteMicroserviceName *string Enabled bool }
SenderTag controls the sender tagging feature. Enabled enables the feature. OverwriteSerialNumber overwrites the serial number with the given value, else the SERIAL_NUMBER env variable is used. OverwriteMicroserviceName overwrites the microservice name with the given value, else the MICROSERVICE_NAME env variable is used.
type TraceValue ¶ added in v1.4.0
func GetTrace ¶ added in v1.4.0
func GetTrace(message *[]sarama.RecordHeader, key string) *TraceValue