Matt
March 15, 2022, 6:23am
1
I think this is a question that should be asked of REDIS, but I have been thus far unable to find a solution for this.
Is there a way to suppress the .outq and .dlq queues from writing to REDIS ?
We have an environment with low resources and this would make things easier to manage.
mythz
March 15, 2022, 7:15am
2
Set DisablePublishingResponses
and DisablePublishingToOutq
when registering RedisMqServer
If you use Request/Reply pattern it will avoid publishing errors to the response queue otherwise it will be published to the .dlq.
1 Like
Matt
March 15, 2022, 7:16am
3
Beautiful thank you.
Also, is there a way to determine number of items in a queue ?
mythz
March 15, 2022, 7:18am
4
They’re just plain Redis lists, so you can just perform a list count on the queue.
If you have #Script SharpPagesFeature
registered you can mix in feature-mq which provides a UI with some more insight.
Otherwise you can fetch stats about MQ Server from IMessageService.GetStatsDescription()
Matt
March 15, 2022, 7:43am
5
Thanks Mythz. The StatsDescription is helpful but appears to only return totals. I am keen for current counts.
I am looking to access the counts in code at the time I enqueue a message into the queue using the mqClient class.
Something along the lines of
if (queue.Count < 1000){
mqClient.Publish(ob1);
}
Is here a servicestack wrapper class that would provide that metric ?
mythz
March 15, 2022, 7:48am
6
There’s no standard way to retrieve the current MQ count.
For the current count in Redis MQ you would need to get the list count of the backing Redis Queue.
For normal MQ’s you can get the Redis MQ List name from QueueNames<T>.In
which you should be able to use with GetListCount()
using ServiceStack’s IRedisClient
or the Redis LLEN command with any other redis client.
Matt
March 15, 2022, 7:51am
7
Will give this a go, thank you
Matt
March 15, 2022, 8:14am
8
It works thank you. I have a solution.
1 Like