Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Exchange names ExchangeDirect = "customeros-direct" ExchangeCustomerOS = "customeros" ExchangeNotifications = "notifications" ExchangeDeadLetter = "dead-letter" // Notification queues QueueNotifications = "notifications" // CustomerOS queues QueueEvents = "events" QueueOpensearch = "events-opensearch" QueueAgents = "events-agents" // CustomerOS Direct queues QueueFlowParticipantSchedule = "events-flow-participant-schedule" // Dead Letter Queues DLQNotificatins = QueueNotifications + "-dlq" DLQEvents = QueueEvents + "-dlq" DLQOpensearch = QueueOpensearch + "-dlq" DLQAgents = QueueAgents + "-dlq" DLQFlowParticipantSchedule = QueueFlowParticipantSchedule + "-dlq" // CustomerOS Direct routing keys RoutingKeyFlowParticipantSchedule = "flow-participant-schedule" // Dead Letter routing key RoutingKeyDeadLetter = "dead-letter" // Default configurations DefaultMessageTTL = 240 * time.Hour // after TTL message moves to DLQ DefaultMaxRetries = 3 DefaultPublishTimeout = 5 * time.Second DefaultReconnectBackoff = time.Second DefaultMaxReconnectBackoff = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventsService ¶
type EventsService struct {
Publisher *RabbitMQPublisher
}
func NewEventsService ¶
func NewEventsService(rabbitmqURL string, log logger.Logger, publisherConfig *PublisherConfig) (*EventsService, error)
func (*EventsService) Close ¶
func (s *EventsService) Close() error
type PublisherConfig ¶
type RabbitMQPublisher ¶
type RabbitMQPublisher struct {
// contains filtered or unexported fields
}
func NewRabbitMQPublisher ¶
func NewRabbitMQPublisher(rabbitmqURL string, logger logger.Logger, config *PublisherConfig) (*RabbitMQPublisher, error)
func (*RabbitMQPublisher) Close ¶
func (r *RabbitMQPublisher) Close() error
Close gracefully shuts down the publisher
func (*RabbitMQPublisher) PublishDirectEvent ¶
func (r *RabbitMQPublisher) PublishDirectEvent(ctx context.Context, entityId string, entityType enum.EntityType, message interface{}) error
func (*RabbitMQPublisher) PublishFanoutEvent ¶
func (r *RabbitMQPublisher) PublishFanoutEvent(ctx context.Context, entityId string, entityType enum.EntityType, message interface{}) error
Click to show internal directories.
Click to hide internal directories.