public void onMessage(Message msg) {
try {
if (!stopped) {
ActiveMQMessage message = (ActiveMQMessage) msg;
if (message != null) {
message = message.shallowCopy();
message.addBrokerVisited(localBrokerName);
Destination destination = message.getJMSDestination();
int deliveryMode = message.getJMSDeliveryMode();
int priority = message.getJMSPriority();
long timeToLive = message.getJMSExpiration() - msg.getJMSTimestamp();