Sorry about that Claus, this is the error:

[1] Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: telegram://bots/ removing the token   due to:
AuthorizationToken must be configured on either component or endpoint for
telegram:
telegram://bots/ removing the token
[1]     at
org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:800)
~[org.apache.camel.
camel-base-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:55)
~[org.apache.camel.
camel-support-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.impl.engine.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:120)
~[org.apache.came
l.camel-base-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:349)
~[org.apache.camel.camel-core-3.0.0-R
C1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:101)
~[org.apache.camel.camel-core-3.0.0-RC1
.jar:3.0.0-RC1]
[1]     ... 16 more
[1] Caused by: java.lang.IllegalArgumentException: AuthorizationToken must
be configured on either component or endpoint fo
r telegram: telegram://bots/removing the token
[1]     at
org.apache.camel.component.telegram.TelegramComponent.createEndpoint(TelegramComponent.java:53)
~[org.apache.cam
el.camel-telegram-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:206)
~[org.apache.camel.camel-sup
port-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:752)
~[org.apache.camel.
camel-base-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:55)
~[org.apache.camel.
camel-support-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.impl.engine.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:120)
~[org.apache.came
l.camel-base-3.0.0-RC1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:349)
~[org.apache.camel.camel-core-3.0.0-R
C1.jar:3.0.0-RC1]
[1]     at
org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:101)
~[org.apache.camel.camel-core-3.0.0-RC1
.jar:3.0.0-RC1]
[1]     ... 16 more
[1] Exception in thread "main"
org.apache.camel.FailedToCreateRouteException: Failed to create route
route1: Route(route1)[


And this is my code:

package com.telus.is.di;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.dataformat.JsonLibrary;
//import org.springframework.stereotype.Component;

//@Component
public class TelegramRoute extends RouteBuilder {


@Override
public void configure() throws Exception {
// TODO Auto-generated method stub

this.from("telegram:bots/removing the token").
streamCaching()
.to("log:INFO?showHeaders=true")
.log("${body}")
.log("${body.from.id}")
.setHeader("id",simple("${body.from.id}"))
.convertBodyTo(String.class)
.choice()
.when(simple("${body.toLowerCase()} contains 'chuck'"))
.to("http4://api.icndb.com/jokes/random")
.log("${body}")
//.setBody(jsonpath("$.value.joke"))
.unmarshal().json(JsonLibrary.Jackson)
.transform(simple("${body[value][joke]}"))
.setBody(simple("Here is a chuck norris joke, :) ${body}"))
.to("telegram:bots/ removing the token ")
.otherwise()
.setBody(simple("${body}, sending message back"))
.to("telegram:bots/removing the token ");
}

}


On Thu, 7 Nov 2019 at 08:30, Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> I cannot see the two pictures you may have attached to this email.
>
>
> On Thu, Nov 7, 2019 at 3:07 PM Pablo Portillo <oswalxt...@gmail.com>
> wrote:
>
> > Hi Guys, i'm exploring Camel K operator with GKE in google cloud and im
> > having issues with the telegram operator, just as a reference the same
> code
> > works smoothly using Spring Boot.
> >
> > This is based on one of your amazing videos in dev nation! Thanks a lot
> > for all the innovation guys!
> >
> > So this is the error there im getting:
> >
> > [image: image.png]
> >
> > And here is my code:
> >
> > [image: image.png]
> >
> >
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Reply via email to