Question
· 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?

Discussion (8)1
Log in or sign up to continue

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"

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.

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.