quarkus: MongoClientBuildItem is never produced

Describe the bug MongoClientProcessor has a build method which is supposed to produce MongoClientBuildItem(s) when the relevant Quarkus Mongo configuration is present. I never see the fields in MongodbConfig be anything other than null, hence the build items never get created.

Having MongoClientBuildItem available, is useful for other extensions like the Camel Mongo extension, where it can fetch the client and wire it into the relevant Camel component.

Expected behavior If any of the Mongo configuration options are set, E.g quarkus.mongodb.hosts or quarkus.mongodb.connection-string then a MongoClientBuildItem should be produced.

Actual behavior No MongoClientBuildItem ever seems to be produced, regardless of the Mongo configuration used.

To Reproduce Steps to reproduce the behavior:

  1. In your IDE, set a breakpoint in MongoClientProcessor at the start of the build method
  2. Launch test BookResourceTest in debug mode
  3. Observe conditions for creating MongoClientBuildItem are never satisfied

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (33 by maintainers)

Commits related to this issue

Most upvoted comments

@loicmathieu, @dufoli your concern has been addressed as well.

With the current version of the PR we all get what we want:

  • I get the fact that the beans are not un-removable by default. They only become un-removable when a build step actually consumes the MongoClientBuildItem (which doesn’t happen by default - Camel is only consumer I know of).
  • Camel get a working version of this build item
  • Loic and Olivier get the implementation they wanted

So we should all be happy with this iteration 😄

@jamesnetherton I just pushed a new iteration of the PR.

Everything should now be back to normal from your POV. I would appreciate it if you gave a go

Yeah most likely. Let me create a draft PR soon with what I have in mind and then you and the Camel folks can try something concrete and see if it’s fits your needs 😃