Yes, it should follow the pattern for listMessages,
i.e. be exposed as a management operation on
org.jboss.mq.server.jmx.Topic (with an optional extra parameter to identify the subscription).
What do you do about messages that have been received by the client but not acknowledged? e.g. removeAllMessages() also removes these, but this may not
be behaviour you want?
I've been thinking about adding an optional parameter:
void removeAllMessages(boolean includingUnackedMessages);
We use only this functionnality on queue. Basically we have a JmsUtilService Mbean which does some operations on queue.
Namely we have a method
removeMessages(Queue queue, String selector, int limit) that removes max "limit" messages matching the specified selector on specified queue. Of course, if exposed directly on the destination level we can remove the queue parameter.
I don't get you with this unacknowledged thing.
Ah ok. Well actually, we remove messages by simply consuming them (QueueReceiver). So the unacknowledged stuff makes no sense in this case.