Ticket System - Retrieve Only One Message and Close Consumer #318
-
I need to create a ticket system, and I will use RabbitMQ Stream because I want to store the offset by user. Then, I will receive one trigger per user and consume the next message for that user. I implemented it like this:
` However, when I run it in my terminal, I receive the message, but I also get the following warning: I'm not sure why I'm getting this warning. How can I avoid logging it or prevent it from appearing? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
Can you please create a full example so I can run it without writing the needed code ? |
Beta Was this translation helpful? Give feedback.
-
Sure:
Populate Ticket Stream Queue:
Ticket Consumer:
|
Beta Was this translation helpful? Give feedback.
-
The log you see is this one. It is not a problem, actually. |
Beta Was this translation helpful? Give feedback.
-
So there is no way for me to fetch a single message and close it without generating these warning logs, only by downloading the library and customizing it locally, right? |
Beta Was this translation helpful? Give feedback.
-
Thank you @gabsferrara but please check: #319 Note: you could still have:
in your case, I suggest using the following: stream.NewConsumerOptions().
SetConsumerName(consumerName).
SetInitialCredits(1).
to reduce the |
Beta Was this translation helpful? Give feedback.
-
No, there is no way. The filter uses bloom filter and is applied to the chunk level. More info here: https://github.com/rabbitmq/rabbitmq-stream-go-client?tab=readme-ov-file#consume-filtering |
Beta Was this translation helpful? Give feedback.
Thank you @gabsferrara but please check: #319
Note: you could still have:
in your case, I suggest using the following:
to reduce the
InitialCredits
.