You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some extension are leveraging extensions, which contains producers for some beans. E.g. google-storage (possibly minio)
Google-storage extension contains StorageProducer, which creates Storage. Camel component autowires Storage into its configuration.
If user tries to leverage this producer with a route using it. It doesn't work and following warning is shown:
================================================================================
CDI: programmatic lookup problem detected
-----------------------------------------
At least one bean matched the required type and qualifiers but was marked as unused and removed during build
Removed beans:
- PRODUCER_METHOD bean io.quarkiverse.googlecloudservices.storage.runtime.StorageProducer#storage() [types=[com.google.cloud.Service<com.google.cloud.storage.StorageOptions>, interface com.google.cloud.storage.Storage], qualifiers=[@javax.enterprise.inject.Default()]]
Required type: interface com.google.cloud.storage.Storage
Required qualifiers: []
Solutions:
- Application developers can eliminate false positives via the @Unremovable annotation
- Extensions can eliminate false positives via build items, e.g. using the UnremovableBeanBuildItem
- See also https://quarkus.io/guides/cdi-reference#remove_unused_beans
================================================================================
Problem is caused by the fact, that quartkus does not know about autowired bean and therefore marks producer as unused and removes it.
If I inject bean into my code, quarkus reconizes it, bean is created and autowired into component.
@Inject
Storage storage;
It would be nice if autowired beans from camel compoinents are recognized by quarkus. This would make configuration of some clients/components much easier for users.
The text was updated successfully, but these errors were encountered:
Yes that should work (make bean unremovable), EDIT I'll make bean unremovable in our extension
Just thinking whether it would be possible to "say to quarkus" that some beans are used, therefore there is no need to remove them as unused.
I didn't find #1387, which makes this issue duplicate.
Some extension are leveraging extensions, which contains producers for some beans. E.g.
google-storage
(possiblyminio
)Google-storage extension contains
StorageProducer
, which createsStorage
. Camel component autowiresStorage
into its configuration.If user tries to leverage this producer with a route using it. It doesn't work and following warning is shown:
Problem is caused by the fact, that quartkus does not know about autowired bean and therefore marks producer as unused and removes it.
If I inject bean into my code, quarkus reconizes it, bean is created and autowired into component.
It would be nice if autowired beans from camel compoinents are recognized by quarkus. This would make configuration of some clients/components much easier for users.
The text was updated successfully, but these errors were encountered: