Runing an enhanced broker cluster with mysql store we see that autocreated queues are not removed from DST table when destination is supposed to be destroyed.
Calling a simple consumer on a nonexsiting queue creates the destination:
java -jar /tools/jms-tests/consumer.jar 3000 xx.xx.xx.xx 37676 testdel
We can see it exists:
imqcmd -b xx.xx.xx.xx:37676 -u admin -pw admin query dst -t q -n testdel
Destination Name Destination Type
testdel Queue
On the broker specified by:
Host Primary Port
xx.xx.xx.xx 37676
Destination Name testdel
Destination Type Queue
Destination State RUNNING
Created Administratively false
Current Number of Messages
Actual 0
Remote 0
Held in Transaction 0
Current Message Bytes
Actual 0
Remote 0
Held in Transaction 0
Current Number of Producers 0
Current Number of Active Consumers 0
Current Number of Backup Consumers 0
Max Number of Messages 100000
Max Total Message Bytes 10737418240
Max Bytes per Message 10485760
Max Number of Producers 100
Max Number of Active Consumers unlimited (-1)
Max Number of Backup Consumers 0
Limit Behavior REJECT_NEWEST
Consumer Flow Limit 1000
Is Local Destination false
Local Delivery is Preferred false
Use Dead Message Queue true
XML schema validation enabled false
XML schema URI List -
Reload XML schema on failure false
Successfully queried the destination.
After we get: Destroying auto-created destination testdel [Queue] inactive for 7200 seconds and destination destroyed message, we can still see queue with query dst.
calling destroy also has no effect
imqcmd -b xx.xx.xx.xx:37676 -u admin -pw admin destroy dst -t q -n testdel
Query that should remove destination looks like this (for both reap and destroy):
DELETE FROM MQDST41Cmqm WHERE ID = 'Q:testdel' AND NOT EXISTS (SELECT FROM MQMSG41Cmqm WHERE DESTINATION_ID = 'Q:testdel') AND NOT EXISTS (SELECT FROM MQBKR41Cmqm WHERE ID <> 'b1' AND STATE = 1)
From what i understand, the last NOT EXISTS (SELECT * FROM MQBKR41Cmqm WHERE ID <> 'b1' AND STATE = 1) would basicly translate into "if there isn't any other active broker in cluster" , so that means we cannot remove any autocreated destination if there are other active nodes in the cluster.
Runing an enhanced broker cluster with mysql store we see that autocreated queues are not removed from DST table when destination is supposed to be destroyed.
Calling a simple consumer on a nonexsiting queue creates the destination: java -jar /tools/jms-tests/consumer.jar 3000 xx.xx.xx.xx 37676 testdel We can see it exists: imqcmd -b xx.xx.xx.xx:37676 -u admin -pw admin query dst -t q -n testdel
Destination Name Destination Type
testdel Queue
On the broker specified by:
Host Primary Port
xx.xx.xx.xx 37676
Destination Name testdel Destination Type Queue Destination State RUNNING Created Administratively false
Current Number of Messages
Actual 0 Remote 0 Held in Transaction 0 Current Message Bytes
Actual 0 Remote 0 Held in Transaction 0 Current Number of Producers 0 Current Number of Active Consumers 0 Current Number of Backup Consumers 0
Max Number of Messages 100000 Max Total Message Bytes 10737418240 Max Bytes per Message 10485760 Max Number of Producers 100 Max Number of Active Consumers unlimited (-1) Max Number of Backup Consumers 0
Limit Behavior REJECT_NEWEST Consumer Flow Limit 1000 Is Local Destination false Local Delivery is Preferred false Use Dead Message Queue true XML schema validation enabled false XML schema URI List - Reload XML schema on failure false
Successfully queried the destination.
After we get: Destroying auto-created destination testdel [Queue] inactive for 7200 seconds and destination destroyed message, we can still see queue with query dst.
calling destroy also has no effect imqcmd -b xx.xx.xx.xx:37676 -u admin -pw admin destroy dst -t q -n testdel
Query that should remove destination looks like this (for both reap and destroy):
DELETE FROM MQDST41Cmqm WHERE ID = 'Q:testdel' AND NOT EXISTS (SELECT FROM MQMSG41Cmqm WHERE DESTINATION_ID = 'Q:testdel') AND NOT EXISTS (SELECT FROM MQBKR41Cmqm WHERE ID <> 'b1' AND STATE = 1)
From what i understand, the last NOT EXISTS (SELECT * FROM MQBKR41Cmqm WHERE ID <> 'b1' AND STATE = 1) would basicly translate into "if there isn't any other active broker in cluster" , so that means we cannot remove any autocreated destination if there are other active nodes in the cluster.