disabled AMQP queue and binding for type topic

This commit is contained in:
uwer 2023-05-03 16:22:37 +10:00
parent dbd565d361
commit c63468a704

View File

@ -93,28 +93,29 @@ func (conn *AMQPConn) Send(msg string) error {
); err != nil { ); err != nil {
return err return err
} }
if conn.ep.AMQP.Type != "topic" {
// Create queue if queue don't exists
if _, err := channel.QueueDeclare(
conn.ep.AMQP.QueueName,
conn.ep.AMQP.Durable,
conn.ep.AMQP.AutoDelete,
false,
conn.ep.AMQP.NoWait,
nil,
); err != nil {
return err
}
// Create queue if queue don't exists // Binding exchange to queue
if _, err := channel.QueueDeclare( if err := channel.QueueBind(
conn.ep.AMQP.QueueName, conn.ep.AMQP.QueueName,
conn.ep.AMQP.Durable, conn.ep.AMQP.RouteKey,
conn.ep.AMQP.AutoDelete, conn.ep.AMQP.QueueName,
false, conn.ep.AMQP.NoWait,
conn.ep.AMQP.NoWait, nil,
nil, ); err != nil {
); err != nil { return err
return err }
}
// Binding exchange to queue
if err := channel.QueueBind(
conn.ep.AMQP.QueueName,
conn.ep.AMQP.RouteKey,
conn.ep.AMQP.QueueName,
conn.ep.AMQP.NoWait,
nil,
); err != nil {
return err
} }
conn.conn = c conn.conn = c