I tested the case on Camel K 2.2 and got the same result. multiple-endpoint.groovy // camel-k: language=groovy
from('knative:endpoint/test1') .log('Trigger from endpoint test1') .setBody().constant('Success test123') from('knative:endpoint/test2') .log('Trigger from endpoint test2') .setBody().constant('Success test246') Command: $ kamel run --profile Knative multiple-endpoint.groovy Result: CAMEL_KNATIVE_CONFIGURATION: {"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"}}]} My expectation: CAMEL_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"}}]} ________________________________ 发件人: Pasquale Congiusti <pasquale.congiu...@gmail.com> 发送时间: 2024年6月25日 17:28 收件人: users@camel.apache.org <users@camel.apache.org> 主题: Re: how to set different path for the different Knative endpoint in Camel K Version 1.10 is very old (2 years or the like). We are not supporting since long time already. The suggestion is to move to version 2.3 which is the latest supporting Camel LTS. Mind that, although running this Camel K version, you can still use any runtime of version 1.x >= 1.17 (which is the default version used in Camel K 1.12). Cheers, Pasquale. On Tue, Jun 25, 2024 at 10:39 AM _ Jane <belief...@hotmail.com> wrote: > 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! > > > > >