//create a publisher and send a persistant message followed by a non persistant message
TopicConnection pubConnection = factory.createTopicConnection("guest", "guest");
TopicSession pubSession = pubConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
TopicPublisher publisher = pubSession.createPublisher(topic);
Message message = pubSession.createMessage();
message.setIntProperty("count", 1);
publisher.publish(message, javax.jms.DeliveryMode.PERSISTENT, javax.jms.Message.DEFAULT_PRIORITY,
javax.jms.Message.DEFAULT_TIME_TO_LIVE);
message.setIntProperty("count", 2);
publisher.publish(message, javax.jms.DeliveryMode.NON_PERSISTENT, javax.jms.Message.DEFAULT_PRIORITY,