// Create spring context
ApplicationContext appCtx = new ClassPathXmlApplicationContext(
"applicationContext-Queue.xml");
// Get JMS template for message sending
MyMessageProducer myMessageProducer = (MyMessageProducer) appCtx
.getBean("myMessageProducer");
long i = 0;
while (true) {
myMessageProducer.sendMessage();
System.out
.printf(
"Msg Count :%s - FreeMemory : %s - MaxMemory : %s - TotalMemory : %s\n",
i, Runtime.getRuntime().freeMemory(), Runtime
.getRuntime().maxMemory(), Runtime