[
https://issues.apache.org/jira/browse/CAMEL-16575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338999#comment-17338999
]
Claus Ibsen commented on CAMEL-16575:
-------------------------------------
You need to provide the class type, but then the bean is lazy
registry.bind("myBar", FooBar.class, () -> {
FooBar bar = new FooBar();
bar.setGreeting("I am lazy " + counter.incrementAndGet());
return bar;
});
> camel-core - Lookup bean if value is Supplier then lazy eval
> -------------------------------------------------------------
>
> Key: CAMEL-16575
> URL: https://issues.apache.org/jira/browse/CAMEL-16575
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.10.0
>
>
> It may be desirable to bind a bean that is lazy evaluated via a Supplier, so
> you can bind a bean that is lambda based.
> context.bind("foo", () -> { ... something that returns a bean ... });
--
This message was sent by Atlassian Jira
(v8.3.4#803005)