diff options
Diffstat (limited to 'plugins/amqp/amqpjobs/rabbit_init.go')
-rw-r--r-- | plugins/amqp/amqpjobs/rabbit_init.go | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/plugins/amqp/amqpjobs/rabbit_init.go b/plugins/amqp/amqpjobs/rabbit_init.go deleted file mode 100644 index fb5f6911..00000000 --- a/plugins/amqp/amqpjobs/rabbit_init.go +++ /dev/null @@ -1,57 +0,0 @@ -package amqpjobs - -import ( - "github.com/spiral/errors" -) - -func (c *consumer) initRabbitMQ() error { - const op = errors.Op("jobs_plugin_rmq_init") - // Channel opens a unique, concurrent server channel to process the bulk of AMQP - // messages. Any error from methods on this receiver will render the receiver - // invalid and a new Channel should be opened. - channel, err := c.conn.Channel() - if err != nil { - return errors.E(op, err) - } - - // declare an exchange (idempotent operation) - err = channel.ExchangeDeclare( - c.exchangeName, - c.exchangeType, - true, - false, - false, - false, - nil, - ) - if err != nil { - return errors.E(op, err) - } - - // verify or declare a queue - q, err := channel.QueueDeclare( - c.queue, - false, - false, - c.exclusive, - false, - nil, - ) - if err != nil { - return errors.E(op, err) - } - - // bind queue to the exchange - err = channel.QueueBind( - q.Name, - c.routingKey, - c.exchangeName, - false, - nil, - ) - if err != nil { - return errors.E(op, err) - } - - return channel.Close() -} |