We use the Request/Reponse pattern for a Redis MessageQueue. The decumentation states:
Note that the HelloResponse will get put back on a 'transient' message queue, mq.HelloResponse.outq with a maximum message limit of 100 (by default). You can subscribe to this queue to get a notification and do further processing, such as recording the number of messages handled. Or you can clear the message NotifyOneWay option to prevent this.
We do not subscribe to this queue, but would like to check the queue regularly to see if the (last 100) messages are returned correctly. After some testing we found over 1 million Response DTOs in the response queue... How do we make sure the queue will only contain 100 messages maximum?
Are you looking for
redisClient.GetListCount("mq:HelloResponse.outq"))? It returns number of messages in queue. If after check you see that list grows large it can be trimmed with Trim method
That's one way to do it, but my question was actually referring to the quoted text on the mentioned web page about the limit of 100. In short: how do I configure the MQ to only keep the last 100 HelloResponse like a transient queue? Any thoughts, or is said web page providing incorrect information?
The max size of out list can be changed in RedisMessageQueueClient but by default it should be
100. If you get another behavior could you provide a standalone sample how you get overflow queue with this setting?
@Rob in previous comment I pointed to the outdated v3 branch, so looks like this setting was removed but documentation was not synced with that change.
Right... I see from the (old) code how this could be done. Would be cool if @mythz could put that feature back as an int? without a default value, se we can chose to have a default here