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 2025/05/08 13:56:00 UTC
[jira] [Resolved] (CAMEL-22053) camel-jbang - Add support for @Inject on bean method that produces a bean
[ https://issues.apache.org/jira/browse/CAMEL-22053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-22053.
---------------------------------
Resolution: Fixed
> camel-jbang - Add support for @Inject on bean method that produces a bean
> -------------------------------------------------------------------------
>
> Key: CAMEL-22053
> URL: https://issues.apache.org/jira/browse/CAMEL-22053
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.12.0
>
>
> This is supported by CEQ where you can do
> {code:java}
> @Inject
> DataSource datasource() {
> org.apache.commons.dbcp2.BasicDataSource ds = new org.apache.commons.dbcp2.BasicDataSource();
> ds.setUsername("{{secret:secret-basic-auth/username}}");
> ds.setPassword("{{secret:secret-basic-auth/password}}");
> ds.setUrl("jdbc:postgresql://{{secret:secret-basic-auth/host}}:{{secret:secret-basic-auth/port:5432}}/testdb");
> ds.setDriverClassName("org.postgresql.Driver");
> return ds;
> } {code}
> this today requires to use the @Produces annotation instead. But we can make Inject do the same as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)