You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/07/02 15:23:00 UTC

[jira] [Resolved] (CAMEL-16769) camel-sql: Being able to use dataSource from the exchange (not from registry)

     [ https://issues.apache.org/jira/browse/CAMEL-16769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-16769.
---------------------------------
    Resolution: Won't Fix

This is not a good practice as a component is a long lived entity.

You can use a java bean and call that from Camel, where you in the bean have some SQL code

> camel-sql: Being able to use dataSource from the exchange (not from registry)
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-16769
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16769
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-sql
>    Affects Versions: 3.11.0
>            Reporter: roberto gasdia
>            Priority: Major
>
> From what I can tell looking at the source code, It doesn't seem to be possible to instantiate a bean with scope Request (or maybe an instance assigned to an exchange property)  and then later have
>  
> .toD("sql:\{my query}?dataSource=..the bean instance)
>  
> wich is mandatory in my use case, because we have a multitenant application where db connection parameters are passed in the request, so we need to be able to create a data source with different settings per each request.
> Having to fetch the data source from the registry we cannot make sure that every request has its own DB properly configured.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)