-
Notifications
You must be signed in to change notification settings - Fork 345
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
Unable to access MongoDB #2684
Comments
/cc @squakez |
I tried to use
but that throws:
while I thought I was eliminating ambiguity by using the type qualifier |
IIRC there is a problem with the way quarkus initializes the mongodb client. I don’t recall the full context, but in the kamelet we had to provide a custom bean I think to override the quarkus defaults: https://github.com/apache/camel-kamelets/blob/790b6b93975a3d73fb6f8d2396c7aca72ef50766/mongodb-source.kamelet.yaml#L69 |
Btw, i believe you can reference the mongo sink and source kamelets directly from your route |
I tried the sink kamelet and it's pod logs also show the same error, on not being able to connect to
when deployed from a declaration like:
|
Well this seems weird. I tested the sink and source Kamelets multiple times and never faced this |
It is indeed weird (I've been fighting this for two days). Ignoring the kamelets for now, if I reference the bean @heiko-braun mentioned in properties, like:
then there is still the
|
The MongoClient does seem to have been refactored, and it seems I should be referencing
But how to add an instance of that type to the Camel context? - there is the factory-like method
|
With the kamelets, you'll get some complaints before the correct connection will be done
But after that you'll get the correct connection, this is something related to underlined quarkus extension
I set 172.17.0.3 on the kameletBinding. It's just logging, but the feature works and I think it is the same for the component. |
Regarding the MongoDB sink kamelet, I tried again deploying the k8s declaration listed above, to grab the full logs which I'll paste in here in case the provide any insights:
|
On my end it's just stuck in "CrashLoopBackOff". Does my deployment declaration above look OK ? |
How does it work for you to run this integration?
|
I should add that this works fine:
|
My test was using this https://github.com/apache/camel-performance-tests/tree/main/profiling/kafka-mongo Which it is using Kamelets in the route definition. Btw I'll try to test on minikube to check |
I'm using the Red Hat OpenShift Container Platform (CodeReady containers, locally on my workstation), and I'm connecting to a MongoDB Atlas cluster (where I've confirmed that the connection string works). |
I could provide in a private message the exact MongoDB Atlas connection string I'm using, which is to a Free Tier Cluster and contains nothing important. |
The problem is that in Camel K we support the default Camel Quarkus MongoDB client named This is the one we used internally in Camel K, and, in order to override its default property (which are that
And then, executing the Integration with:
See documentation for more details about how to configure the properties to store the values you need. |
Thanks @squakez, the quarkus.mongodb... properties is what I was missing; I was stuck at The kamelets didn't work on my end; does that mean they are also not setting those properties correctly, or did I somehow fail to deploy them correctly? - example above. |
Kamelets are working. They have been tested for 1.6 by the way I'll try to reproduce. On minikube at least i don't see this |
I tried again and cannot reproduce on the kamelets side. |
By the way your kamelet error seems to be related to knative not to mongodb org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: knative://channel/isgattchannel?apiVersion=messaging.knative.dev%2Fv1&kind=Channel due to: Cannot load Knative configuration from file or env variable |
Thanks for checking this out @oscerd. I tried applying the Kubernetes declaration above again and get the same error. The Camel-K operator works in the same Red Hat CodeReady Containers cluster, so Knative seems to be working in some aspects there. |
@bthj This is a slightly different way to connect to mongodb and not using the camel-quarkus property. |
This issue has been automatically marked as stale due to 90 days of inactivity. |
I'm experiencing a somehow similar issue.
and here you can find the error log: I'm on version 1.6.5 of camel-k on OpenShift |
When trying to access a MongoDB Atlas Free Tier Cluster with a Camel-K integration Java file like:
and deploy it with Camel K Client 1.6.0 to a camel-k-operator.v1.6.0 with the command:
kamel run MongoDBTest.java --dev
it results in the error:127.0.0.1:27017
- is there something I should add to have the integration communicate with the correct hosts?The text was updated successfully, but these errors were encountered: