camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huntc <>
Subject Re: requestBodyAndHeader and HEADER_CLOSE_SESSION_WHEN_COMPLETE
Date Sat, 23 Jan 2010 07:08:45 GMT

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();

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


  } finally {

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,
View this message in context:
Sent from the Camel - Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message