It is not recommended that you make decisions regarding persistence at the application code level. Persistence can be configured in the Administrative Console independent of the code facilitating maintainability and reuseability. The subject is covered here only for completeness.
Using persistence on a message destination should only be used when needed if performance is a requirement. WebSphere MQ and the default messaging provider have the option to leave destination persistence decisions at the application level by setting the persistence for a queue or topic as APPLICATION DEFINED.
The javax.jms.MessageProducer interface includes setDeliveryMode() which can be used to set a persistent or non-persistent delivery mode.
By default, persistence is turned on for a message producer.