Why not exposing your service with the interface, but instead of exposing directly an instance, use a per-thread pooling mechanism ?
2016-10-20 13:10 GMT+02:00 cniehues <christian.nieh...@its-telco.de>: > Hi Tim, > > You are right, maybe the thread node was a little bit too confusing. > > Here is a concrete example: > I am receiving SOAP messages with camel cxf endpoints that will result in > some complex operations lasting some time. To reach a quick processing of > the messages I use camel:seda with concurrent consumers. So if all > underlying operations will use singleton services I think I will loose the > advantage of the parallel processing and will get trouble with keeping > things thread-safe. Also I want to have some stateful services holding > intermediate data or working like a cache for each specific SOAP request. > This is the reason why I want to have different service instances for each > SOAP request but also want the same instance if I use the service again in > a > later step in another bundle. > > I hope my requirements are a little more clear now. Currently we are using > JBoss AS6 and achieve this requirements with our own ComponentFactory and > now we want to switch the application to the OSGI world. > > Regards > > Christian > > > > -- > View this message in context: http://karaf.922171.n3.nabble. > com/Best-practice-for-context-specific-service-instances- > tp4048410p4048470.html > Sent from the Karaf - User mailing list archive at Nabble.com. > -- ------------------------ Guillaume Nodet ------------------------ Red Hat, Open Source Integration Email: gno...@redhat.com Web: http://fusesource.com Blog: http://gnodet.blogspot.com/