MQMessageProducer(MQSession session, MQProducer producer, Destination dest) throws JMSException { this.session = session; targetProducer = producer; destination = dest; session.addProducer(this); if (session.isStarted()) { start(); } }
@Override public void close() throws JMSException { try { if (started.get()) { targetProducer.shutdown(); targetProducer = null; session.removeProducer(this); started.set(false); } } catch (Exception ex) { throw JMSExceptionSupport.create(ex); } }