Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs enhancement: Add warning about multiple Reactive Mongodb Clients #45388

Closed

Conversation

MaciejDromin
Copy link
Contributor

I was trying to create multiple reactive MongoDB clients using following configuration property:

quarkus.mongodb.client1.connection-string=mongodb://localhost:27017/db1
quarkus.mongodb.client2.connection-string=mongodb://localhost:27017/db2

And then using them two different Entities:

@MongoEntity(clientName = "client1")
...
@MongoEntity(clientName = "client2")

I quickly found out that it is not possible but couldn't find anything in the docs about it. To avoid confusion I propose this doc enhancement.

Signed-off-by: Maciej Lisowski <macieejl00@gmail.com>
Copy link

github-actions bot commented Jan 6, 2025

🙈 The PR is closed and the preview is expired.

Copy link

quarkus-bot bot commented Jan 6, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit bd43d15.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@geoand
Copy link
Contributor

geoand commented Jan 7, 2025

This seems odd to me as I don't remember any specific reason why what you tried originally would not work.
Do you have a sample application that shows the problem in action?

@MaciejDromin
Copy link
Contributor Author

This seems odd to me as I don't remember any specific reason why what you tried originally would not work. Do you have a sample application that shows the problem in action?

Sure, I will try to create a small reproducer later today

@MaciejDromin
Copy link
Contributor Author

@geoand You were right, it was my bad I was trying to inject regular client which obviously didn't work. But when I was creating the reproducer I confirmed other issue. When trying to use two different reactive clients, quarkus is always creating ryuk and mongodb containers even tho I have a running mongo on default port. What's odd is, it is not even using it.
image
image
There is no such issue when running a single client.
image
image
Here is the reproducer:
https://github.com/MaciejDromin/mongo-quarkus-issue
https://github.com/MaciejDromin/mongo-quarkus-issue/tree/single-client

@geoand
Copy link
Contributor

geoand commented Jan 8, 2025

@MaciejDromin thanks for finding that! Unfortunately fixing this requires is a bit tricky and I've opened #45388 to track it.

@geoand geoand closed this Jan 8, 2025
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jan 8, 2025
@MaciejDromin MaciejDromin deleted the mongodb-panache-improvement branch January 8, 2025 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants