producer = session.createProducer(destination);
MessageProducer producer = session.createProducer(destination);
    public void process(MessageExchange exchange) throws Exception {        if (exchange.getStatus() == ExchangeStatus.DONE) {            return;        } else if (exchange.getStatus() == ExchangeStatus.ERROR) {            return;        }        try {            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);            if (destination == null) {                if (STYLE_QUEUE.equals(endpoint.getDestinationStyle())) {                    destination = session.createQueue(endpoint.getJmsProviderDestinationName());                } else {                    destination = session.createTopic(endpoint.getJmsProviderDestinationName());                }            }            producer = session.createProducer(destination);                        TextMessage msg = session.createTextMessage();            NormalizedMessage nm = exchange.getMessage("in");            fromNMS(nm, msg);                if (exchange instanceof InOnly || exchange instanceof RobustInOnly) {                producer.send(msg);            } else if (exchange instanceof InOut) {                if (destination instanceof Queue) {                    replyToDestination = session.createTemporaryQueue();                } else {                    replyToDestination = session.createTemporaryTopic();                }                consumer = session.createConsumer(replyToDestination);                msg.setJMSCorrelationID(exchange.getExchangeId());                msg.setJMSReplyTo(replyToDestination);                producer.send(msg);                Message message = consumer.receive();                if (message instanceof ObjectMessage) {                    Object o = ((ObjectMessage) message).getObject();                    if (o instanceof Exception) {                        exchange.setError((Exception) o);                    } else {                        throw new UnsupportedOperationException("Can not handle objects of type " + o.getClass().getName());                    }                } else {                    InputStream is = null;                    if (message instanceof TextMessage) {                        is = new ByteArrayInputStream(((TextMessage) message).getText().getBytes());                    } else if (message instanceof BytesMessage) {                        int length = (int) ((BytesMessage) message).getBodyLength();                        byte[] bytes = new byte[length];                        ((BytesMessage) message).readBytes(bytes);                        is = new ByteArrayInputStream(bytes);                    } else {                        throw new IllegalArgumentException("JMS message should be a text or bytes message");                    }                    String contentType = message.getStringProperty(CONTENT_TYPE);                    SoapMessage soap = soapHelper.getSoapMarshaler().createReader().read(is, contentType);                    NormalizedMessage out = exchange.createMessage();                    soapHelper.getJBIMarshaler().toNMS(out, soap);                    ((InOut) exchange).setOutMessage(out);                }                channel.send(exchange);            } else {                throw new IllegalStateException(exchange.getPattern() + " not implemented");            }        } finally {            if (session != null) {                session.close();            }        }    }