broker

package
v0.0.0-...-fa04af2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SECURITY_PROTOCOL = "SASL_SSL"
	SASL_MECHANISMS   = "PLAIN" // "SCRAM-SHA-256"
)
View Source
const (
	AUTO_OFFSET_RESET = "earliest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Producer
	Consumer
	TopicAccountBE, TopicAccountCUD   string
	TopicProductBE, TopicProductCUD   string
	TopicOrderBE, TopicOrderCUD       string
	TopicDeliveryBE, TopicDeliveryCUD string
	TopicBillingBE, TopicBillingCUD   string
}

Broker

func NewBroker

func NewBroker(service *service.Service, config *config.Broker) (*Broker, error)

NewBroker - constructor

type BrokerConsume

type BrokerConsume struct {
	TopicAccountBE, TopicAccountCUD   string
	TopicProductBE, TopicProductCUD   string
	TopicOrderBE, TopicOrderCUD       string
	TopicDeliveryBE, TopicDeliveryCUD string
	TopicBillingBE, TopicBillingCUD   string
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(service *service.Service, conf *config.Broker) (*BrokerConsume, error)

func (*BrokerConsume) ProcessEvent

func (k *BrokerConsume) ProcessEvent(event domain.Event)

func (*BrokerConsume) Subscribe

func (k *BrokerConsume) Subscribe() error

type BrokerProduce

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

func NewProducer

func NewProducer(conf *config.Broker) (*BrokerProduce, error)

func (*BrokerProduce) Produce

func (k *BrokerProduce) Produce(evetType domain.EventType, eventTopic string, eventPayload interface{}) error

type Consumer

type Consumer interface {
	Subscribe() error
	ProcessEvent(event domain.Event)
}

type Producer

type Producer interface {
	Produce(evetType domain.EventType, eventTopic string, eventPayload interface{}) error
}

Jump to

Keyboard shortcuts

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