Documentation
¶
Index ¶
- Constants
- func NewPublisher(config PublisherConfig, logger watermill.LoggerAdapter) message.Publisher
- func NewSubscriber(config SubscriberConfig, logger watermill.LoggerAdapter) (message.Subscriber, error)
- func TCP4(address ...string) net.Addr
- type DefaultMarshaler
- type Marshaler
- type MarshalerUnmarshaler
- type Publisher
- type PublisherConfig
- type Subscriber
- type SubscriberConfig
- type Unmarshaler
Constants ¶
View Source
const HeaderKey = "_key"
View Source
const NoSleep time.Duration = -1
View Source
const UUIDHeaderKey = "_watermill_message_uuid"
Variables ¶
This section is empty.
Functions ¶
func NewPublisher ¶
func NewPublisher(config PublisherConfig, logger watermill.LoggerAdapter) message.Publisher
func NewSubscriber ¶
func NewSubscriber(config SubscriberConfig, logger watermill.LoggerAdapter) (message.Subscriber, error)
Types ¶
type DefaultMarshaler ¶
type DefaultMarshaler struct { }
type MarshalerUnmarshaler ¶
type MarshalerUnmarshaler interface { Marshaler Unmarshaler }
type PublisherConfig ¶
type PublisherConfig struct { Writer *kafka.Writer Brokers []string Async bool // Marshaler is used to marshal messages from Watermill format into Kafka format. Marshaler Marshaler // If true then each sent message will be wrapped with Opentelemetry tracing, provided by otelsarama. OTELEnabled bool Ipv4Only bool Timeout time.Duration }
func (*PublisherConfig) Validate ¶
func (c *PublisherConfig) Validate() error
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func (*Subscriber) Close ¶
func (s *Subscriber) Close() error
type SubscriberConfig ¶
type SubscriberConfig struct { Brokers []string Unmarshaler Unmarshaler OverrideReaderConfig kafka.ReaderConfig ConsumerGroup string NackResendSleep time.Duration ReconnectRetrySleep time.Duration OTELEnabled bool }
func (SubscriberConfig) Validate ¶
func (c SubscriberConfig) Validate() error
type Unmarshaler ¶
Click to show internal directories.
Click to hide internal directories.