Yes. Karaf 4 Camel 3 and currently migrating some projects to camel 4. Just came over this alternative bean creation code an was wondering how to use it.
Br, Matthias Jean-Baptiste Onofré <[email protected]> schrieb am Mo., 9. Dez. 2024, 18:36: > Hi > > Are you using camel-karaf 4.x ? > > Regards > JB > > On Tue, Nov 26, 2024 at 9:59 AM Matthias Leinweber > <[email protected]> wrote: > > > > Hello Karafers, > > > > i think this isnt the best place for this camel/blueprint related > question but i think there are not many places where i could drop this > question. > > Newer versions of camel support script based bean definitions: > > <bean name="myBean" type="com.foo.MyBean" > > scriptLanguage="groovy"> > > <script> > > <!-- groovy code here to create the bean --> > > </script> > > </bean> > > > > This is not blueprint compatible. However, in camels Modelparser.java i > found: > > return (def, key) -> { > > if > > ("http://www.osgi.org/xmlns/blueprint/v1.0.0".equals(parser.getNamespace())) > { > > Element el = doParseDOMElement("blueprint", " > http://www.osgi.org/xmlns/blueprint/v1.0.0", def.getBlueprintBeans()); > > if (el != null) { > > doAddElement(el, def.getBlueprintBeans(), > def::setBlueprintBeans); > > return true; > > } > > return false; > > } > > if > > ("http://www.springframework.org/schema/beans".equals(parser.getNamespace())) > { > > Element el = doParseDOMElement("beans", " > http://www.springframework.org/schema/beans", def.getSpringBeans()); > > if (el != null) { > > doAddElement(el, def.getSpringBeans(), > def::setSpringBeans); > > return true; > > } > > return false; > > } > > switch (key) { > > case "bean": doAdd(doParseBeanFactoryDefinition(), > def.getBeans(), def::setBeans); break; > > ..... > > > > so is it somehow possible to set the namespace of the <bean element to > something so that the modelparsers bean creation is used instead of this > from the blueprint processing? In a routeTemplate (with templateBean) i got > it partially working... > > > > br; > > matthias > > > > > > > > >
