You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Pablo Portillo <os...@gmail.com> on 2019/11/07 14:07:40 UTC

Issues with Camel K and Telegram component

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]

Re: Issues with Camel K and Telegram component

Posted by Pablo Portillo <os...@gmail.com>.
Thanks a lot!

El jue., 7 nov. 2019 11:55 a. m., Claus Ibsen <cl...@gmail.com>
escribió:

> I think it was RC3 or thereabouts, its only for Camel 3 though
>
> On Thu, Nov 7, 2019 at 6:52 PM Pablo Portillo <os...@gmail.com>
> wrote:
> >
> > Thnks Claus!, since which version do you change this? just as a
> reference.
> >
> > On Thu, 7 Nov 2019 at 11:35, Claus Ibsen <cl...@gmail.com> wrote:
> >
> > > Hi
> > >
> > > Ah okay we changed the camel-telegram component a bit how its
> configured.
> > >
> > > So you should do now
> > > telegram:bots?authorizationToken={{token}}
> > >
> > >
> > > On Thu, Nov 7, 2019 at 3:36 PM Pablo Portillo <os...@gmail.com>
> > > wrote:
> > > >
> > > > 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 <cl...@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 <
> oswalxtiyo@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
> > > > >
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > http://davsclaus.com @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> > >
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: Issues with Camel K and Telegram component

Posted by Claus Ibsen <cl...@gmail.com>.
I think it was RC3 or thereabouts, its only for Camel 3 though

On Thu, Nov 7, 2019 at 6:52 PM Pablo Portillo <os...@gmail.com> wrote:
>
> Thnks Claus!, since which version do you change this? just as a reference.
>
> On Thu, 7 Nov 2019 at 11:35, Claus Ibsen <cl...@gmail.com> wrote:
>
> > Hi
> >
> > Ah okay we changed the camel-telegram component a bit how its configured.
> >
> > So you should do now
> > telegram:bots?authorizationToken={{token}}
> >
> >
> > On Thu, Nov 7, 2019 at 3:36 PM Pablo Portillo <os...@gmail.com>
> > wrote:
> > >
> > > 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 <cl...@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 <os...@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
> > > >
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Issues with Camel K and Telegram component

Posted by Pablo Portillo <os...@gmail.com>.
Thnks Claus!, since which version do you change this? just as a reference.

On Thu, 7 Nov 2019 at 11:35, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Ah okay we changed the camel-telegram component a bit how its configured.
>
> So you should do now
> telegram:bots?authorizationToken={{token}}
>
>
> On Thu, Nov 7, 2019 at 3:36 PM Pablo Portillo <os...@gmail.com>
> wrote:
> >
> > 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 <cl...@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 <os...@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
> > >
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: Issues with Camel K and Telegram component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah okay we changed the camel-telegram component a bit how its configured.

So you should do now
telegram:bots?authorizationToken={{token}}


On Thu, Nov 7, 2019 at 3:36 PM Pablo Portillo <os...@gmail.com> wrote:
>
> 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 <cl...@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 <os...@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
> >



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Issues with Camel K and Telegram component

Posted by Pablo Portillo <os...@gmail.com>.
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 <cl...@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 <os...@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
>

Re: Issues with Camel K and Telegram component

Posted by Claus Ibsen <cl...@gmail.com>.
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 <os...@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