Closed justjack1521 closed 3 months ago
I have upgraded to v0.14.2 and am running into issues with consumer.Run() being blocking code, for example, in the below code "Consumer running" will never print, unless consumer.Run() is wrapped in a goroutine.
consumer, err := rabbitmq.NewConsumer( conn, "client.update", rabbitmq.WithConsumerOptionsRoutingKey("client.disconnected"), rabbitmq.WithConsumerOptionsExchangeName("client"), rabbitmq.WithConsumerOptionsExchangeDeclare, rabbitmq.WithConsumerOptionsExchangeDurable, ) if err != nil { log.Fatal(err) } defer consumer.Close() log.Println("Consumer created") err = consumer.Run(func(d rabbitmq.Delivery) (action rabbitmq.Action) { return rabbitmq.Ack }) if err != nil { log.Fatal(err) } log.Println("Consumer running")
Is this intended behaviour?
This has been expected for awhile iirc, the examples indicate the same
I have upgraded to v0.14.2 and am running into issues with consumer.Run() being blocking code, for example, in the below code "Consumer running" will never print, unless consumer.Run() is wrapped in a goroutine.
Is this intended behaviour?