Re: Get Bundle Version from CamelContext or CamelMessage

2022-07-08 Thread Ephemeris Lappis
Hello. Yes, I mean one of the (>100) bundles that contain the Camel's routes. The code that must retrieve the version is not in these bundles, but in a common one that exposes services that are called on events (EventNotifier). Such external services do not know the name of the Camel routes

Re: Get Bundle Version from CamelContext or CamelMessage

2022-07-08 Thread Jean-Baptiste Onofré
Hi what do you mean by "your bundle" ? You mean the one containing the route ? If your bundle just contains the blueprint xml, the most secure way is to get the bundle list, filter by your name to get the version. Regards JB On Fri, Jul 8, 2022 at 10:45 AM Ephemeris Lappis wrote: > > Hello

Re: Get Bundle Version from CamelContext or CamelMessage

2022-07-08 Thread Ephemeris Lappis
Hello again ! I've tested it, but I'm afraid the solution #2 doesn't work as is. With the following code, the retrieved bundle seems to be the system's bundle that creates the exchange, not mine : // e is the current Exchange final Bundle bundle = FrameworkUtil.getBundle(e.getClass()); return

Re: Get Bundle Version from CamelContext or CamelMessage

2022-07-07 Thread Ephemeris Lappis
Hello Thanks for your answer. Your solution #2 should be better since it doesn't imply a modification of our almost hundred projects. Does it mean that the Exchange class is always managed in a class loader that's in the scope of each bundle ? I'm going to try that and confirm it works in

Re: Get Bundle Version from CamelContext or CamelMessage

2022-07-07 Thread Jean-Baptiste Onofré
Hi, You have two ways to do that: 1. in your blueprint XML, you can inject blueprintBundleContext (implicit bean) in your camel route/processor. 2. you can do FrameworkUtil.getBundle(Exchange.class).getBundleContext() Regards JB On Thu, Jul 7, 2022 at 4:33 PM Ephemeris Lappis wrote: > > Hello.

Get Bundle Version from CamelContext or CamelMessage

2022-07-07 Thread Ephemeris Lappis
Hello. I'd like to know if there's some way to retrieve the bundle version from either the CamelContext or the CamelMessage objects. The code should be executed in a service that is provided from another bundle. I suppose I could get the BundleContext using the