added updated test case for the publisher implementation

This commit is contained in:
MohitKatare-protean
2025-05-06 12:08:56 +05:30
parent 72f8be52fa
commit 2e0b5834d7
2 changed files with 76 additions and 1 deletions

View File

@@ -22,10 +22,15 @@ type Config struct {
UseTLS bool
}
// Channel defines the interface for publishing messages to RabbitMQ.
type Channel interface {
PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp091.Publishing) error
}
// Publisher manages the RabbitMQ connection and channel to publish messages.
type Publisher struct {
Conn *amqp091.Connection
Channel *amqp091.Channel
Channel Channel
Config *Config
}