Hi Pasquale,

Thanks for your reply!

I'm using Camel K 1.10. And I hope to find a way to achieve it without 
upgrading the Camel K version, such as using Camel properties or Camel K trait. 
I've tried to use below Camel k trait but failed.

$ kamel run --name multi-endpoint --profile Knative --trait 
knative.configuration='{"services":[{"type":"endpoint","name":"test1","path":"/test1","metadata"
:{"camel.endpoint.kind":"source","knative.apiVersion":"serving.knative.dev/v1","knative.kind":"Service"}},{"type":"endpoint","name":"test2","path":"/test2","metadata":{"camel.endpoint.kind":"source","knative.apiVersion":"serving
.knative.dev/v1","knative.kind":"Service"}}]}' MultiEndpointRoute.java

Error: 1 error(s) decoding:

* 'knative.Configuration' expected a map, got 'string'

Is there any good idea?
________________________________
发件人: Pasquale Congiusti <pasquale.congiu...@gmail.com>
发送时间: 2024年6月24日 17:30
收件人: users@camel.apache.org <users@camel.apache.org>
主题: Re: how to set different path for the different Knative endpoint in Camel K

Hello there.
What version of Camel K are you using? In the most recent versions we have
changed the way this is configured, and it's possible this issue got
solved. Can you try running the same with the latest stable releases?

Thanks,
Pasquale.

On Mon, Jun 24, 2024 at 10:04 AM _ Jane <belief...@hotmail.com> wrote:

> Dear Community,
>
> I want to define 2 routes with Knative endpoint consumer as below:
>
>
> from("knative:endpoint/test1")
>         .routeId("route_inbound_knative1")
>         .log("Trigger from test1 endpoint")
>         .setBody(constant("Success test1"));
>
> from("knative:endpoint/test2")
>         .routeId("route_inbound_knative2")
>         .log("Trigger from test2 endpoint")
>         .setBody(constant("Success test2"));
>
> After deploy it with "kamel run" command, the auto-generated
> CAMEL_KNATIVE_CONFIGURATION is as below:
>
>
> {"services":[{"type":"endpoint","name":"test1","path":"/","metadata":{"camel.endpoint.kind":"source","knative.apiVersion":"
> serving.knative.dev/v1
> ","knative.kind":"Service"}},{"type":"endpoint","name":"test2","path":"/","metadata":{"camel.endpoint.kind":"source","knative.apiVersion":"
> serving.knative.dev/v1","knative.kind":"Service"}}]}
>
> How can I set different path for these 2 Knative endpoint like "/test1"
> and "/test2"?
>
> Thanks!
>
>

Reply via email to