Hello

czw., 20 paź 2022 o 17:54 Ephemeris Lappis <[email protected]>
napisał(a):

> 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 :
>

Which Fuse version do you mean?


>
> [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 ?
>

In Fuse 6 there's "connector" feature:

    <feature name="connector" description="OSGi support for JCA Connector
1.6" version="3.1.1" resolver="(obr)">
        <details>OSGi support for JCA Connector 1.6</details>
        <feature version="[1.1,2)">transaction</feature>
        <bundle
dependency="true">mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.6_spec/1.0</bundle>
        <bundle
dependency="true">mvn:javax.validation/validation-api/1.1.0.Final-redhat-1</bundle>

<bundle>mvn:org.apache.geronimo.components/geronimo-connector/3.1.1</bundle>
        <bundle
start-level="30">mvn:org.apache.aries.transaction/org.apache.aries.transaction.jdbc/2.1.3</bundle>
    </feature>

And the "wrapping" is done by org.apache.aries.transaction.jdbc.

Are you thinking about configuring it correctly in Karaf or in Fuse?

regards
Grzegorz Grzybek


>
> 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
>

Reply via email to