I have a query with Websphere MQ. I want to list all the queue where the queue depth is greater is zero.
something like :
runmqsc queue_manager_name
DISPLAY QLOCAL(*) WHERE(CURDEPTH) GT 0
not sure about the syntax. Can someone please help
DISPLAY QLOCAL(*) WHERE(CURDEPTH GT 0)
Related
there are some messages in the rabbitmq queue, but sometimes I can't get current message count in the queue, I always get 0 count between the 2 am and 6 am,but after that it is back to normal
code picture
log picture
rabbit mq can not get current message counts
How to write runmqsc Mq command to display queues for curdepth is greater than 80% of maxdepth? I have tried but no luck.
It is not possible to do this with native MQSC commands alone.
It is possible to do this if you use MQSCX from MQGem Software and the =WHERE clause (an enhancement over the IBM MQ WHERE clause). Then you can use the following command:-
DISPLAY QLOCAL(*) =WHERE(CURDEPTH GT MAXDEPTH * 0.8)
As Morag said, runmqsc does not support what you want. I posted a Java/MQ program that basically does what you want. You can find the code here: How to display local queues where curdepth reached its maxdepth in ibm mq
I an using JMS in weblogic. If my MDB throws an exception, the message is redelivered. The problem I am trying to fix is set a message redelivery limit. Because the message deleivery does not stop. Goes over 300 times until I delete the entire deployment. I have done set message redelivery in JBOSS, but I am new to weblogic, and I want to set redelivery limit for this queue alone.
I have looks at this post here : https://docs.oracle.com/cd/E24329_01/web.1211/e24387/implement.htm#JMSPG233
But that did not help.
Where do I set the max number of times this message should be delivered ?
Thanks
Redelivery Limit on WebLogic 12c is default to -1, which means it will try 2147483647 times before it give up. Try lower this value to something like 10, maybe.
You should search for this tab inside your queue and change the default value for Redelivery Limit.
Hope it helps !
I'd like to use the WSADMIN command that is part of WebSphere 7 to query the state of the queues on the system.
Can anyone help me out?
Thanks
For anyone interested, here's the jython version of jeff's answer.
qpoint = 'WebSphere:*,type=SIBQueuePoint'
queues = AdminControl.queryNames(qpoint).split()
for q in queues:
identifier = AdminControl.getAttribute(q, 'identifier')
size = AdminControl.getAttribute(q, 'depth')
print identifier + ' size: ' + size + ' messages'
print AdminControl.getAttributes(q)
So to find out the queue depths I've written this JACK script...
set qpoint "WebSphere:*,type=SIBQueuePoint"
set queues [$AdminControl queryNames $qpoint]
foreach q $queues {
set identifier [$AdminControl getAttribute $q identifier]
set size [$AdminControl getAttribute $q depth]
puts "$identifier size: $size messages"
puts [$AdminControl getAttributes $q]
Stuff it in a file on the box, jeff.jacl and call the command...
/opt/IBM/WebSphere/AppServer/bin # ./wsadmin.sh -profile jp.cmd.jacl
And what do you get? well you get a whole bag of awesomeness!
WASX7209I: Connected to process "server1" on node WRSNode using SOAP connector; The type of process is: UnManagedProcess
CHANGE_REQUEST size: 15 messages
{depth 15} {state ACTIVE} {id CFAC834BE6AF5D9A30451D01_QUEUE_51} {identifier CHANGE_REQUEST} {highMessageThreshold 50000} {sendAllowed true}
ETL_DEAD size: 378 messages
Next job is to see if I can all the java code that is used by JACL directly.
In order to retrieve the depth of a SIB queue using the WebSphere PMI, you will need to select the following two counters:
AvailableMessageCount and UnavailableMessageCount
Here is how: From the WebSphere Application Server Admin Console, go to the Performance Monitoring Infrastructure (PMI) panel of the application server where the messaging engine is hosted:
Application servers > your_app_server_name > Performance Monitoring Infrastructure (PMI)
You will be on the Configuration tab by default. You can choose to switch to the Runtime tab if you wish this monitoring to start without restarting the application server.
Once on the PMI panel, click on the link "Custom", the label of the last radio button. This should take you to the Custom monitoring level panel. From the left-hand navigation tree, select:
- SIB Service
- SIB Messaging Engines - *- Destinations- Queues Select both counters: AvailableMessageCount and UnavailableMessageCount and click the Enable button located at the top. Your setting should be saved at this point.
This question refers to the dequeueing of messages in Oracle Streams Advanced Queueing.
I need to ensure that the messages which are related to each other are processed sequentially.
For example, assume the queue is seeded with the four messages that have a business-related field called transaction reference (txn_ref) and two of the messages (1,3) belong to the same transaction (000001):
id | txn_ref |
---+---------+
1 | 000001 |
2 | 000002 |
3 | 000001 |
4 | 000003 |
Assume also that I am running 4 threads/processes that wish to dequeue from this queue. The following should occur:
thread 1 dequeues message #1
thread 2 dequeues message #2
thread 3 dequeues message #4 (because message #3 is related to #1 and #1 has not yet completed).
thread 4 blocks waiting for a message
thread 1 commits its work for message #1
thread 4 (or perhaps thread 1) dequeues message #3.
My initial thought was that I could achieve this with a dequeue condition where the ENQ_TIME (enqueue time) is not later than any other ENQ_TIME of all the messages that have the same TXN_REF. But my problem is how to reference the TXN_REF of a message that I have not yet selected, in order to select it. e.g.
// Java API
String condition = "ENQ_TIME = (select min(ENQ_TIME) from AQ_TABLE1 where ??";
dequeueOption.setCondition(condition);
Is it possible to achieve what I want here?
To answer your direct question, this can be achieved using the correlation field (called CORRID in the table), which is designed for this purpose.
So, on the enqueue, you'd use the AQMessageProperties.setCorrelation() method with the TXN_REF value as the parameter. Then, in your condition you would do something like this:
// Java API
String condition = "tab.ENQ_TIME = (select min(AQ_TABLE1.ENQ_TIME) from AQ_TABLE1 self where tab.CORRID=AQ_TABLE1.CORRID)";
dequeueOption.setCondition(condition);
A strategy which you can try, if possible, is using Message Groups. The Oracle Documentation describes it briefly, but I found this Toad World article to be far more useful. Basically, you setup the queue table to treat all messages committed at the same time as one "group". When dequeueing, only one user at a time can dequeue from a "group" of messages.