fix close channel by queue redecleration
@@ -57,12 +57,7 @@ func (r *RabbitMQ) Init(metadata bindings.Metadata) error {
}
func (r *RabbitMQ) Write(req *bindings.WriteRequest) error {
- q, err := r.channel.QueueDeclare(r.metadata.QueueName, r.metadata.Durable, r.metadata.DeleteWhenUnused, false, false, nil)
- if err != nil {
- return err
- }
-
- err = r.channel.Publish("", q.Name, false, false, amqp.Publishing{
+ err := r.channel.Publish("", r.metadata.QueueName, false, false, amqp.Publishing{
ContentType: "text/plain",
Body: req.Data,
})
@@ -95,7 +90,7 @@ func (r *RabbitMQ) Read(handler func(*bindings.ReadResponse) error) error {
msgs, err := r.channel.Consume(
q.Name,
"",
- true,
+ false,
false,
false,
false,
