Spring-Web has the notion of a "request-scope", which binds the lifetime of the instance to a Thread. That's likely what you want. As soon as you spin-off a new Thread within you route (using async components, like seda, jms or similiar) Spring would create a new instance.
However, not sure if this scope requires a Web-Context. But at least maybe you could roll your own based in that one. On Tue, Jul 29, 2014 at 10:48 PM, David Karlsen <davidkarl...@gmail.com> wrote: > Maybe create an instance and stick it into a camel header (the header will > follow the exchange, and thus the lifecycle of passing through the route).? > > > 2014-07-29 22:10 GMT+02:00 rickaroni <rgfa...@directv.com>: > >> Hi Michael, >> >> I hear you. The trouble is, sometimes the intermediate transports (e.g. >> the >> Camel Salesforce component) hijack the header and body for their own needs >> and you don't have full control over them. >> >> In similar ESBs, I've seen some shops make their own custom Spring message >> scope to be the lifetime of (the equivalent of) a route. >> >> That works pretty nicely when it's needed. I was hoping to avoid having to >> write this myself, but can if needed. >> >> Thanks a lot, >> Rick >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/to-bean-xxx-or-not-to-bean-xxx-Getting-clarity-on-bean-scope-tp5754593p5754609.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> > > > > -- > -- > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen