Written by

Question Jon Astle · Jul 2, 2019

Ensemble Queue Counts Incorrect

A couple of our queues in Ensemble are reporting a queue count of one however there are no messages in the queue.  Does anyone know what the best method is to reset to the queue count back to zero or remove one from the queue count?

Comments

Jeffrey Drumm · Jul 2, 2019

So when you select the queue in the Queues page, it shows no messages in the Queue Contents column?

0
Jon Astle  Jul 2, 2019 to Jeffrey Drumm

No the queue is empty when you click on the queue to show the content

0
Jeffrey Drumm  Jul 2, 2019 to Jon Astle

From the Cache prompt in  your production's namespace, what do you see when you type:

PROD> zw ^Ens.Queue("QueueName")

?

Replace QueueName with the name of the queue in question ...

0
Jon Astle  Jul 3, 2019 to Jeffrey Drumm

TIE>zw ^Ens.Queue("ClinicomMsgRouter")
^Ens.Queue("ClinicomMsgRouter",0,"count")=1
^Ens.Queue("ClinicomMsgRouter",0,"job","sys",1340)=""
^Ens.Queue("ClinicomMsgRouter",0,"job","sys",3960)=""
^Ens.Queue("ClinicomMsgRouter",0,"job","sys",12712)=""
^Ens.Queue("ClinicomMsgRouter",0,"next")=3011778
^Ens.Queue("ClinicomMsgRouter",0,"time")="2019-04-09 13:05:52.292"

TIE>zw ^Ens.Queue("PathologyRouter")
^Ens.Queue("PathologyRouter",0,"count")=1
^Ens.Queue("PathologyRouter",0,"job","sys",7984)=""
^Ens.Queue("PathologyRouter",0,"job","sys",8536)=""
^Ens.Queue("PathologyRouter",0,"job","sys",8632)=""
^Ens.Queue("PathologyRouter",0,"job","sys",8680)=""
^Ens.Queue("PathologyRouter",0,"job","sys",9504)=""
^Ens.Queue("PathologyRouter",0,"job","sys",13436)=""
^Ens.Queue("PathologyRouter",0,"next")=7955386
^Ens.Queue("PathologyRouter",0,"time")="2019-02-18 16:18:10.018"

0
Jeffrey Drumm · Jul 3, 2019

I'm reasonably confident this will fix the issue without any side effects ...

TIE> Set ^Ens.Queue("ClinicomMsgRouter",0,"count")=0
TIE> Set ^Ens.Queue("PathologyRouter",0,"count")=0

Question though ... do you have the pool size for these routers set higher than 1? I'm concerned about the number of job entries  under each queue. This could have an impact on FIFO, and may have something to do with the erroneous queue counts.

0
Jon Astle  Jul 3, 2019 to Jeffrey Drumm

Both routers have a pool size of 1.  I presume I will  need to disable the routers before I set the count to zero or would it be safer to set the count to count minus one in the event that messages are passing through the routers at the time I reset the count?

0
Jeffrey Drumm  Jul 3, 2019 to Jon Astle

So ... before you go changing those globals (if you haven't done so already), try

TIE> do ##class(Ens.Queue).AbortQueue("queuename") 

Once you've turned down all of the inbound services/processes. If that doesn't work, use my previous suggestion.

I do think you should shut down the services and processes feeding the routers. And it wouldn't hurt to shut down the routers as well.

If the count is still at 1 after you do that, set the value to 0. And I actually think that the job IDs are from the source services and processes, not the routers themselves.

0
Jon Astle  Jul 5, 2019 to Jeffrey Drumm

Tried the AbortQueue name which did not work so went on to stop anything that feeds the two routers and the reset the queue counts to zero which worked a treat.  Thanks Jeff.

0