I am consuming Tibco JMS (EMS) messages from a queue... I want to clear the queue each time the application runs. I can think of the below logic... I thought their might be a better way
public void clearMessages() throws JMSException{
Message msg = (Message) queueReceiver.receiveNoWait();
while(msg != null)
{
clearMessages();
}
return;
}