This commit is contained in:
parent
49bdd1cf19
commit
775aeecd74
1 changed files with 20 additions and 2 deletions
|
|
@ -49,13 +49,22 @@ func New(deps Deps) TaskTransport {
|
|||
func (h *Handler) initConsumer(deps *Deps) error {
|
||||
log.WithField("enabled", deps.LoggingEnabled).Debugf("%v rabbit mq logger", pkgLogHeader)
|
||||
|
||||
opts := rabbit.QueueOpts{
|
||||
QueueName: deps.TaskSourceQueue,
|
||||
Durable: true,
|
||||
AutoDelete: false,
|
||||
Exclusive: false,
|
||||
NoWait: false,
|
||||
Args: nil,
|
||||
}
|
||||
|
||||
client, err := rabbit.NewClient(rabbit.Address{
|
||||
Username: deps.Username,
|
||||
Password: deps.Password,
|
||||
Host: deps.Host,
|
||||
Port: deps.Port,
|
||||
Vhost: deps.Vhost,
|
||||
}, deps.TaskSourceQueue, rabbit.WithLogging(deps.LoggingEnabled))
|
||||
}, opts, rabbit.WithLogging(deps.LoggingEnabled))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -65,13 +74,22 @@ func (h *Handler) initConsumer(deps *Deps) error {
|
|||
}
|
||||
|
||||
func (h *Handler) initProducer(deps *Deps) error {
|
||||
opts := rabbit.QueueOpts{
|
||||
QueueName: deps.TaskResultQueue,
|
||||
Durable: false,
|
||||
AutoDelete: false,
|
||||
Exclusive: false,
|
||||
NoWait: false,
|
||||
Args: nil,
|
||||
}
|
||||
|
||||
client, err := rabbit.NewClient(rabbit.Address{
|
||||
Username: deps.Username,
|
||||
Password: deps.Password,
|
||||
Host: deps.Host,
|
||||
Port: deps.Port,
|
||||
Vhost: deps.Vhost,
|
||||
}, deps.TaskResultQueue, rabbit.WithLogging(deps.LoggingEnabled))
|
||||
}, opts, rabbit.WithLogging(deps.LoggingEnabled))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue