brokers

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultQueueGroupID is the default queue name used by brokers
	DefaultQueueGroupID = "asyncapi"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaController added in v0.19.0

type KafkaController struct {
	// contains filtered or unexported fields
}

KafkaController is the Kafka implementation for asyncapi-codegen

func NewKafkaController added in v0.19.0

func NewKafkaController(hosts []string, options ...KafkaControllerOption) *KafkaController

NewKafkaController creates a new KafkaController that fulfill the BrokerLinker interface

func (*KafkaController) Publish added in v0.19.0

func (c *KafkaController) Publish(ctx context.Context, channel string, um extensions.BrokerMessage) error

Publish a message to the broker

func (*KafkaController) SetLogger added in v0.19.0

func (c *KafkaController) SetLogger(logger extensions.Logger)

SetLogger set a custom logger that will log operations on broker controller

func (*KafkaController) Subscribe added in v0.19.0

func (c *KafkaController) Subscribe(ctx context.Context, channel string) (msgs chan extensions.BrokerMessage, stop chan interface{}, err error)

Subscribe to messages from the broker

type KafkaControllerOption added in v0.19.0

type KafkaControllerOption func(controller *KafkaController)

func WithGroupID added in v0.19.0

func WithGroupID(groupID string) KafkaControllerOption

func WithMaxBytes added in v0.19.0

func WithMaxBytes(maxBytes int) KafkaControllerOption

func WithPartition added in v0.19.0

func WithPartition(partition int) KafkaControllerOption

type NATSController added in v0.19.4

type NATSController struct {
	// contains filtered or unexported fields
}

NATSController is the NATSController implementation for asyncapi-codegen

func NewNATSController added in v0.19.4

func NewNATSController(connection *nats.Conn) *NATSController

NewNATSController creates a new NATS that fulfill the BrokerLinker interface

func (*NATSController) Publish added in v0.19.4

func (c *NATSController) Publish(_ context.Context, channel string, bm extensions.BrokerMessage) error

Publish a message to the broker

func (*NATSController) SetLogger added in v0.19.4

func (c *NATSController) SetLogger(logger extensions.Logger)

SetLogger set a custom logger that will log operations on broker controller

func (*NATSController) SetQueueGroup added in v0.19.4

func (c *NATSController) SetQueueGroup(name string)

SetQueueGroup sets a custom queue group name for channel subscription

It can be used for multiple applications listening one the same channel but wants to listen on different queues.

func (*NATSController) Subscribe added in v0.19.4

func (c *NATSController) Subscribe(ctx context.Context, channel string) (msgs chan extensions.BrokerMessage, stop chan interface{}, err error)

Subscribe to messages from the broker

Jump to

Keyboard shortcuts

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