brokers

package
v0.19.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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) SetQueueName added in v0.19.0

func (c *KafkaController) SetQueueName(name string)

SetQueueName sets a custom queue name for channel subscription

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

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 NATS

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

NATS is the NATS implementation for asyncapi-codegen

func NewNATS

func NewNATS(connection *nats.Conn) *NATS

NewNATS creates a new NATS that fulfill the BrokerLinker interface

func (*NATS) Publish

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

Publish a message to the broker

func (*NATS) SetLogger

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

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

func (*NATS) SetQueueName

func (c *NATS) SetQueueName(name string)

SetQueueName sets a custom queue name for channel subscription

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

func (*NATS) Subscribe

func (c *NATS) 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