----------------------
osgi.service.blueprint.compname = dataSource
org.talend.esb.datasource.name = ds-derby
osgi.jndi.service.name = jdbc/sam
service.id = 359
service.bundleid = 379
service.scope = bundle
Provided by :
Talend ESB :: SAM :: Datasource :: Derby (379)
Used by:
Talend ESB :: SAM :: Server (425)
Talend ESB :: SAM :: REST Service (427)
Talend ESB :: SAM :: SOAP Service (428)
----------------------
osgi.service.blueprint.compname = dataSource
org.talend.esb.datasource.name = ds-sqlserver
osgi.jndi.service.name = jdbc/sam
service.id = 454
service.bundleid = 556
service.scope = bundle
Provided by :
Talend ESB :: SAM :: Datasource :: SQLServer (556)
As you can notice, the two datasources have the same value for the property "osgi.jndi.service.name".
I created a route calling a job through a cTalendJob component. The job transform the message and store data in a SQL Server database. In the tMSSQLOutput, I set the datasource alias to "ds-sqlserver".
When I try to publish and deploy the route in the runtime, the job isn't working.
I had a look to the job's blueprint.xml file and I found that :
<property name="dataSources">
<map>
<entry key="ds-sqlserver">
<reference interface="javax.sql.DataSource" filter="(
osgi.jndi.service.name=ds-sqlserver)" />
</entry>
</map>
</property>
This can't work as there are two services with the same JNDI service name (jdbc/sam) and none with "ds-sqlserver". If I change the filter to "(org.talend.esb.datasource.name=ds-sqlserver)", it works.
How can I configure this filter in Talend Studio? Or can I change the JNDI Service Name of the bundle "Talend ESB :: SAM :: Datasource :: SQLServer" through Karaf?
I don't want to change the blueprint.xml of my job every time I deploy the route.
Thank you.
I found a workaround but it's clearly ugly. If I configure the datasource alias with the value "jdbc/sam)(org.talend.esb.datasource.name=ds-sqlserver", it works
In the blueprint\job.xml, the datasource appears like this :
<entry key="jdbc/sam)(org.talend.esb.datasource.name=ds-sqlserver">
<reference interface="javax.sql.DataSource" filter="
(osgi.jndi.service.name=jdbc/sam)(org.talend.esb.datasource.name=ds-sqlserver)" />
</entry>
IMHO, it's a workaround and not a real solution. There is an existing JIRA asking for a property "osgi.jndi.service.name" configurable outside the bundle :
https://jira.talendforge.org/browse/TESB-7671 Do you know if you can resolve this JIRA in a future release?
Thank you.
Have you already reported a ticket on talend support portal? Our colleagues from support team will check your issue to see if it is possible to give you a patch on it.
Best regards
Sabrina