public synchronized void run() {
try {
for (int i = 0; i < 10; ++i) {
MessageProducer producer = session.createProducer(queue);
synchronized (session) {
session.notifyAll();
}
if (producer == null) {
msg = "Producer should not be null";
}
TimeUnit.SECONDS.sleep(1);