Description
The admin purge command does not work with a message selector.
A patch is forth coming, there is some cleanup, and compliance to be vetted before I can attach the patch.
(1) Browse with no arguments:
user@activemq-master:~/activemq$ activemq-admin browse --amqurl tcp://localhost:61616 --view JMSTimestamp queue.FOO.BAR
Java Runtime: Sun Microsystems Inc. 1.6.0_22
/home/y/libexec/jdk1.6.0/jre
Heap sizes: current=60800k free=58531k max=902976k
JVM args: -Dactivemq.classpath=""
-Djavax.net.ssl.trustStoreType=JKS
ACTIVEMQ_HOME: /home/y/libexec/activemq
ACTIVEMQ_BASE: /home/y/libexec/activemq
JMS_HEADER_FIELD:JMSTimestamp = 1310608108263
JMS_HEADER_FIELD:JMSTimestamp = 1310608108740
JMS_HEADER_FIELD:JMSTimestamp = 1310608109283
JMS_HEADER_FIELD:JMSTimestamp = 1310608109790
JMS_HEADER_FIELD:JMSTimestamp = 1310608110324
JMS_HEADER_FIELD:JMSTimestamp = 1310608110831
JMS_HEADER_FIELD:JMSTimestamp = 1310608111374
JMS_HEADER_FIELD:JMSTimestamp = 1310608111872
JMS_HEADER_FIELD:JMSTimestamp = 1310608112415
JMS_HEADER_FIELD:JMSTimestamp = 1310608113005
(2) Browse with msgsel
user@activemq-master:~/activemq$ activemq-admin browse --amqurl tcp://localhost:61616 --view JMSTimestamp --msgsel 'JMSTimestamp<1310608110324' queue.FOO.BAR
Java Runtime: Sun Microsystems Inc. 1.6.0_22
/home/y/libexec/jdk1.6.0/jre
Heap sizes: current=60800k free=58535k max=902976k
JVM args: -Dactivemq.classpath=""
-Djavax.net.ssl.trustStoreType=JKS
ACTIVEMQ_HOME: /home/y/libexec/activemq
ACTIVEMQ_BASE: /home/y/libexec/activemq
JMS_HEADER_FIELD:JMSTimestamp = 1310608108263
JMS_HEADER_FIELD:JMSTimestamp = 1310608108740
JMS_HEADER_FIELD:JMSTimestamp = 1310608109283
JMS_HEADER_FIELD:JMSTimestamp = 1310608109790
(3) Purge with msgsel: - Not Working - (what I wanted here was to use only those
matching my criteria)
user@activemq-master:~/activemq$ activemq-admin purge --msgsel 'JMSTimestamp<1310608110324' queue.FOO.BAR
Java Runtime: Sun Microsystems Inc. 1.6.0_22
/home/y/libexec/jdk1.6.0/jre
Heap sizes: current=60800k free=58531k max=902976k
JVM args: -Dactivemq.classpath=""
-Djavax.net.ssl.trustStoreType=JKS
ACTIVEMQ_HOME: /home/y/libexec/activemq
ACTIVEMQ_BASE: /home/y/libexec/activemq
Connecting to JMX URL:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:1
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:2
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:3
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:4
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:5
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:6
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:7
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:8
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:9
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:32:1:1:10
from queue: queue.FOO.BAR
(4) Purge with msgsel working with a patch:
user@activemq-master:~/activemq$ activemq-admin browse --amqurl tcp://localhost:61616 --view JMSTimestamp --msgsel 'JMSTimestamp<1310608391914' queue.FOO.BAR
Java Runtime: Sun Microsystems Inc. 1.6.0_22
/home/y/libexec/jdk1.6.0/jre
Heap sizes: current=60800k free=58535k max=902976k
JVM args: -Dactivemq.classpath=""
-Djavax.net.ssl.trustStoreType=JKS
ACTIVEMQ_HOME: /home/y/libexec/activemq
ACTIVEMQ_BASE: /home/y/libexec/activemq
JMS_HEADER_FIELD:JMSTimestamp = 1310608389116
JMS_HEADER_FIELD:JMSTimestamp = 1310608389607
JMS_HEADER_FIELD:JMSTimestamp = 1310608390266
JMS_HEADER_FIELD:JMSTimestamp = 1310608390781
JMS_HEADER_FIELD:JMSTimestamp = 1310608391390
user@activemq-master:~/activemq$ ./activemq-admin purge --msgsel 'JMSTimestamp<1310608391914' queue.FOO.BAR
Java Runtime: Sun Microsystems Inc. 1.6.0_22
/home/y/libexec/jdk1.6.0/jre
Heap sizes: current=60800k free=58575k max=902976k
JVM args: -Dactivemq.classpath=""
-Djavax.net.ssl.trustStoreType=JKS
ACTIVEMQ_HOME: /home/y/libexec/activemq
ACTIVEMQ_BASE: /home/y/libexec/activemq
Connecting to JMX URL:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
INFO: Addobjects is :[JMSTimestamp<1310608391914]
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:33:1:1:1
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:33:1:1:2
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:33:1:1:3
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:33:1:1:4
from queue: queue.FOO.BAR
INFO: Removing message:
ID:activemq-master-55970-1309958858075-2:33:1:1:5
from queue: queue.FOO.BAR