Hello again. Looking at my old Fuse installations I found that the bundle that wraps XADatasource services is "mvn:org.apache.aries.transaction/org.apache.aries.transaction.wrappers/1.0.0". Installing it manually, it seems to wrap my XADataSource into a simple "XA aware" DataSource. Now I can see the 2 services :
[javax.sql.DataSource] ---------------------- aries.xa.aware = true aries.xa.name = xa-fifi aries.xa.pooling = true aries.xa.poolMaxSize = 10 aries.xa.poolMinSize = 3 datasource.name = postgresql-fifi osgi.jndi.service.name = jdbc/fifi osgi.service.blueprint.compname = dsBean service.bundleid = 124 service.id = 251 service.ranking = 1000 service.scope = singleton Provided by : Fifi-T26 :: DB (124) Used by: Fifi-T26 :: Camel (186) System Bundle (0) [javax.sql.XADataSource] ------------------------ aries.xa.name = xa-fifi aries.xa.pooling = true aries.xa.poolMaxSize = 10 aries.xa.poolMinSize = 3 datasource.name = postgresql-fifi osgi.jndi.service.name = jdbc/fifi osgi.service.blueprint.compname = dsBean service.bundleid = 124 service.id = 210 service.scope = bundle Provided by : Fifi-T26 :: DB (124) Used by: Fifi-T26 :: DB (124) System Bundle (0) And my Camel routes seem to get the expected DataSource and run as expected... at least for elementary tests. So, my question is now : Instead of setting this bundle as a dependency of my service feature, is there an existing Karaf feature that could be more suitable to be a dependency ? Thanks again. Regards. Le jeu. 20 oct. 2022 à 14:46, Ephemeris Lappis <[email protected]> a écrit : > > Hello. > > I'm trying to configure a XADataSource exposed by a bundle and a > feature. (see the attachment). > > The bundle is a single blueprint that creates the PostgreSQL XA > DataSource and exposes it as a service. > > I set Aries XA properties to let Aries wrapping my datasource : I hope > this works in my case. At the bundle level, > > The service appears like that : > [javax.sql.XADataSource] > ------------------------ > aries.xa.name = xa-fifi > aries.xa.pooling = true > aries.xa.poolMaxSize = 10 > aries.xa.poolMinSize = 3 > datasource.name = postgresql-fifi > osgi.jndi.service.name = jdbc/fifi > osgi.service.blueprint.compname = dsBean > service.bundleid = 124 > service.id = 210 > service.scope = bundle > Provided by : Fifi-T26 :: DB (124) > Used by: > System Bundle (0) > > My feature (see attachment), declares a non-XA DataSource capability, > what is perhaps wrong... > <capability>osgi.service;objectClass=javax.jdbc.DataSource);effective:=active</capability> > > Should I declare a double capability with XADataSource ? > > But my Camel routes bundle references a jaxa.sql.DataSource service > with the needed jndi name, but fails with this error message. > > Unable to start container for blueprint bundle > my-test-26-karaf-2-routes/0.0.1.SNAPSHOT due to unresolved > dependencies > [(&(osgi.jndi.service.name=jdbc/fifi)(objectClass=javax.sql.DataSource))] > > The same pattern works on Red-Hat Fuse with a XADataSource exposed > service and a DataSource reference in the routes bundles, because > Aries TM is wrapping the service to auto-enlist connections in JTA > transactions... > > What's wrong here ??? > Someone with any experience on transactions ? > > Thanks in advance. > > Regards. > > > I expect Aries to wrap ml
