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
Camel Rest Kafka Connector - Issue with Kubernetes Rest connector. #1171
Comments
You need to add one of the following components in the connector unzipped folder: This should solve the 'Cannot find RestConsumerFactory in Registry or as a Component to use' |
Please wherein the kind: KafkaConnector script do I add the components in the connector unzipped and can you show me a sample in the k8s script above? |
How are you deploying the connector? |
After deploying strimzi Kafka connect cluster then deploy kafka connector Please how do I add does "..._components_supporting_rest_dsl " into the script? |
How do you include the connector in your strimzi Kafka connect instance? You should have added it somewhere. |
I followed the doc from strimzi for the sample than for my usage I just need to ingress REST API payload via Camel Rest Kafka Connector. |
you need to add one of the component listed in the documentation in the zip declared in the Strimzi example. It will be unzipped with the connector. This is for making it start I don't think by the way that this is component you're looking for. The Rest component will expose the Rest service, but to consume from it you'll need to invoke the service through a different component, for example a timer or http. |
Argh - Please which Kafka connector will do the REST API source into Kafka connect? |
I would not use any connector for doing this. I would do a plain camel route from(timer).to("http://rest-api").to("kafka") |
Therefore, I should use camel-timer-kafka-connector with from(timer).to("http://rest-api").to("kafka") |
No, you should use camel main project. |
What do you mean with ingress? So you mean ingress kubernetes resource? It could be it is just me, but i don't quite get your use case from your description. Maybe elaborate a bit. |
I'll explain the project to data input from REST API into Kafka (strimzi) in k8s. |
You want to invoke a REST endpoint and send the response to Kafka cluster right? |
Yes - REST endpoint http://api.open-notify.org/astros.json into Kafka cluster |
So, I would do it in plain camel or through camel-k with a kamelet, I wouldn't use the camel-kafka-connector in this case. |
So I'm confused here, so I only need Apache Camel K as a producer into Kafka? |
Yes, because in this moment, it's not supported to invoke a timer, then another endpoint and then ingest to kafka, through camel-kafka-connector. It will be supported when we'll support kamelet even in camel-kafka-connector (work in progress). So, yes, at this point I would do that through camel-k. I can also create a sample if needed. |
Please can you create a sample REST endpoint http://api.open-notify.org/astros.json into kafka bootstrapServers: my-cluster-kafka-bootstrap:9092 |
I can create a kamelet invoking that endpoint every 5 seconds or whatever and write the response to a kafka topic in your cluster. |
Yes Please |
I'll try to do this next week. |
Thank you and also please can you include API endpoint that requires username and password or tokens |
Not sure about this, you'll need something that works, for the auth part or other part, you can do by yourself after the example. |
no problem .. just the general task |
Please update me on the progress? |
I'll work on this when I have time. Probably next week. Not sure. |
I'm closing this, because I think it's not related to ckc anymore. |
last part
|
Please follow the instructions. You need to install the Kamelet files before the flow binding file and all must be done in the same namespace of strimzi. So Kafka. It's in the readme. |
I updated the readme for clarity |
It worked, so the instructions it to install in namespace : kafka
Therefore, I need to install them both in order? |
point 2 and 3 are in the kafka namespace. To run the binding you'll need the kafka source, the order is not important, but you need both. |
Thank you - Is there anything I need to config to make it in production to a real REST API endpoint? |
This will work with any non-authenticated http url |
Am trying to get this authentication HTTPS URL to work, but am unsure if am using the correct properties for username and password.
|
You may need to modify this: https://github.com/apache/camel-kamelets/blob/main/http-sink.kamelet.yaml and add the required parameters listed here: https://camel.apache.org/components/3.9.x/http-component.html authMethod, authUsername and authPassword and modify the flow-binding accordingly. In the installation you'll need to do kubectl apply -f http-sink.kamelet.yaml -n kafka too. |
Am I on the right track? - WIP
|
yes but in the
You need to specify also the new parameters
Then you'll need to specify this parameters into the flow-binding in http-sink part |
ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (main) Failed to start application
Any ideas? |
Try with
|
|
It seems is not indented correctly. |
Also the type for username and password should be "string" |
Here's the code..
|
Did you modified the flow binding too? |
Modified code
|
I'll try to reproduce, but i think is on your side |
The http sink seems to be wrong: This is the correct one. Method was missing and you were passing GET as authentication method.
This is the flow binding
|
After installing : kamel install -n kafka Run the following commands kubectl apply -f kafka-not-secured-sink.yaml -n kafka kubectl apply -f http-sink.kamelet.yaml -n kafka kubectl apply -f flow-binding.yaml -n kafka Check logs kamel logs timer-http-kafka -n kafka
|
It doesn't seems you changed the flow binding. Please paste what you're deploying. But also, try to check why something is failing. If we're going ahead in this way, I'll solve the problem for you, but you won't be able to use this approach for anything else. So maybe read a bit of documentation. Don't copy/paste stuff just to make things work. |
I understand I'll study more on the doc, but is the kafka-not-secured-sink file a generic kemel for kafka, it's function? here's flow-binding.yaml
|
http-sink.kamelet.yaml
|
kafka-not-secured-sink.kamelet.yaml
|
If you noticed in the http sink I posted the name is "http-sink-kamelet" So the correct flow-binding is
|
This will work if you installed the http-sink yaml I posted. |
Argh - I see and this is training on camel k for me..lol |
Awesome it works - Thank you and now flowing the structure of camel-k. |
I have an issue creating a CAMEL REST KAFKA-CONNECTOR in k8s and I just want to ingress REST API payload in Kafka strimzi.
Any ideas of the resolve and I'll be able to test the Kafka connector.
Error msg:
The text was updated successfully, but these errors were encountered: