On Sat, Jan 23, 2010 at 8:41 PM, huntc <hu...@mac.com> wrote: > > Hi Claus, > > I'm happy to create a ticket of course, however I'm not clear on what the > resolution is. I am not sure that implementing a "disconnect" URI option is > the way to go though as per FTP. My use case is that I want to establish a > connection, send multiple messages within a loop through that *same* > connection and then close the connection. > > I do not think that I want to change my URI for just the last message > sent... that sounds a little messy. I suppose a header value would get over > this as per consuming messages from MINA and would be nicer programatically. > > However and most importantly, if I use a template then I do not think > there's a guarantee that I'm going to send through the same connection each > time I send a message in my loop i.e. if another thread decides also to send > messages through the same URI then could it: (i) hijack the same connection; > and (ii) potentially cause my subsequent messages to go over another > connection? Neither of these two scenarios would be good. > > While we're figuring this out, is my usage of a Producer directly valid as a > work-around? >
Yes its a very good workaround as you invoke the stop method after use which means it will terminate the session. In fact you should not see this as a workaround as its using the API as it was meant to be used. Its however often we use the higher level API such as ProducerTemplate for those one-liners. > Kind regards, > Christopher > -- > View this message in context: > http://old.nabble.com/requestBodyAndHeader-and-HEADER_CLOSE_SESSION_WHEN_COMPLETE-tp27175565p27289240.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus