Hi guys,

Turns out that I'm using MinaProducer and not MinaConsumer of course;
MinaConsumer is the one that has the HEADER_CLOSE_SESSION_WHEN_COMPLETE
logic and MinaProducer isn't so capable by the looks of it.

I was hoping that stopping the template by calling its stop method would in
turn cause the MinaProducer to close its session. It does not.

I then reverted to the lower level method of creating a producer for my
endpoint and then using the following logic:


  CamelContext camelContext = exchange.getContext();

  Endpoint endpoint = camelContext.getEndpoint(smsSenderEndpoint);
  Producer producer = endpoint.createProducer();
  producer.start();

  try {
    ...
    
    // For each message to send
    Exchange smsExchange = producer.createExchange();
    smsExchange.getIn().setBody(requestMessage);
    producer.process(smsExchange);
    Object replyMessage = smsExchange.getOut().getBody();

    …

  } finally {
        producer.stop();
  }


Is this the best approach for sending out a stream of messages through the
same channel and then ensuring that the channel is closed down; or should we
be looking at some new functionality perhaps in the form of some header or
method indicating that a session should be closed by the producer?

Kind regards,
Christopher
-- 
View this message in context: 
http://old.nabble.com/requestBodyAndHeader-and-HEADER_CLOSE_SESSION_WHEN_COMPLETE-tp27175565p27283994.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to