I can't reach an endpoint in openshift via rest() component

312 Views Asked by At

For a study project I got the task to deploy route definitions to openshift for automated route generation. I need to use openshift and camel k for this task. My problem is that no matter what I do, I am not able to reach my endpoint. Here are the things I already did:

  1. Walked through this tutorial: https://developers.redhat.com/blog/2019/04/25/build-and-deploy-an-api-with-camel-k-on-red-hat-openshift/

but since camel K 1.3.1 this tutorial seems to not work anymore...

  1. I found a tutorial about jetty, but in the end I got the info that for http endpoints in camel there is quarkus being used.

  2. When starting to describe my endpoint in camel k I need to specify a kind of path and here is where things got complicated.

Whatching a tutorial (https://www.youtube.com/watch?v=YpVVXDnZLPo&t=385s) from Tom D I copied everything he did but the difference is he specifies a local host endpoint whereas I try to reach an endpoint in openshift.

    import java.time.Period;

import org.apache.camel.builder.RouteBuilder;

public class RestVersuch extends RouteBuilder {
    @Override
    public void configure() throws Exception {

        ///apis/camel.apache.org/v1/namespaces/pidi-dario/integrations/rest-versuch
        rest()
                .path("/rest-versuch")

                .get()
                .route()
                .transform(simple("GET funktioniert!"))
                .endRest()

                .post()
                .route()
                .to("log:info")
                .transform(simple("POST funktioniert!"))
                .endRest();
    }
}

youtube snap from example code

working service in openshift

As you can see in the pictures everything seems to work fine BUT for some reason camel shuts down shortly after starting the service from my cmd (as an admin):

cmd info log

When I try to open the app from openshifts direct link that you can see in picture 4 I only get a a massage that my app is not available.

applycation not available

Since I am very new to this topic I really hope any of you guys can help me in this particular situation! Thanks for your time reading this post :)!

0

There are 0 best solutions below