Setting a route-id for REST DSL routes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting a route-id for REST DSL routes

rajith
I have a route as follows

rest("myapplication")
   .get("/{pathPram1}")
   .outType(MyClass.class)
   .to("direct:myroute")

Camel by default adds a routeId to it as "routexx"

I want to set a meaningful route-id to the above
1. To turn logging on off for certain routes.
2. When I look at the routes via JMX I can easily figure it out which one
it is.

Is there an easy way to accomplish the above?

Regards,

Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
Reply | Threaded
Open this post in threaded view
|

Re: Setting a route-id for REST DSL routes

Luis Javier Jiménez Ordás
Have you tried something like:


rest("myapplication")

   .id("MyRouteId")
   .get("/{pathPram1}")
   .outType(MyClass.class)
   .to("direct:myroute")

Regards.


________________________________
De: Rajith Muditha Attapattu <[hidden email]>
Enviado: jueves, 16 de febrero de 2017 18:05
Para: [hidden email]
Asunto: Setting a route-id for REST DSL routes

I have a route as follows

rest("myapplication")
   .get("/{pathPram1}")
   .outType(MyClass.class)
   .to("direct:myroute")

Camel by default adds a routeId to it as "routexx"

I want to set a meaningful route-id to the above
1. To turn logging on off for certain routes.
2. When I look at the routes via JMX I can easily figure it out which one
it is.

Is there an easy way to accomplish the above?

Regards,

Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
2rlabs.com&nbsp;-&nbsp;This website is for sale!&nbsp;-&nbsp;2rlabs Resources and Information.<http://rajith.2rlabs.com/>
rajith.2rlabs.com
This website is for sale! 2rlabs.com is your first and best source for all of the information you're looking for. From general topics to more of what you would expect to find here, 2rlabs.com has it all. We hope you find what you are searching for!



Reply | Threaded
Open this post in threaded view
|

Re: Setting a route-id for REST DSL routes

Luis Javier Jiménez Ordás
Sorry, I meant


rest("myapplication")

   .routeId("MyRouteId")
   .get("/{pathPram1}")
   .outType(MyClass.class)
   .to("direct:myroute")

Regards.

________________________________
De: Luis Javier Jiménez Ordás <[hidden email]>
Enviado: jueves, 16 de febrero de 2017 18:18
Para: [hidden email]
Asunto: Re: Setting a route-id for REST DSL routes


Have you tried something like:


rest("myapplication")

   .id("MyRouteId")
   .get("/{pathPram1}")
   .outType(MyClass.class)
   .to("direct:myroute")

Regards.


________________________________
De: Rajith Muditha Attapattu <[hidden email]>
Enviado: jueves, 16 de febrero de 2017 18:05
Para: [hidden email]
Asunto: Setting a route-id for REST DSL routes

I have a route as follows

rest("myapplication")
   .get("/{pathPram1}")
   .outType(MyClass.class)
   .to("direct:myroute")

Camel by default adds a routeId to it as "routexx"

I want to set a meaningful route-id to the above
1. To turn logging on off for certain routes.
2. When I look at the routes via JMX I can easily figure it out which one
it is.

Is there an easy way to accomplish the above?

Regards,

Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
2rlabs.com&nbsp;-&nbsp;This website is for sale!&nbsp;-&nbsp;2rlabs Resources and Information.<http://rajith.2rlabs.com/>
rajith.2rlabs.com
This website is for sale! 2rlabs.com is your first and best source for all of the information you're looking for. From general topics to more of what you would expect to find here, 2rlabs.com has it all. We hope you find what you are searching for!



Reply | Threaded
Open this post in threaded view
|

Re: Setting a route-id for REST DSL routes

rajith
That doesn't work due to not being in the API for the REST DSL.
But you could do .route().routeId()

Was expecting .routeId() to work directly or if there's something that we
missed.


On Thu, Feb 16, 2017 at 1:19 PM, Luis Javier Jiménez Ordás <
[hidden email]> wrote:

> Sorry, I meant
>
>
> rest("myapplication")
>
>    .routeId("MyRouteId")
>    .get("/{pathPram1}")
>    .outType(MyClass.class)
>    .to("direct:myroute")
>
> Regards.
>
> ________________________________
> De: Luis Javier Jiménez Ordás <[hidden email]>
> Enviado: jueves, 16 de febrero de 2017 18:18
> Para: [hidden email]
> Asunto: Re: Setting a route-id for REST DSL routes
>
>
> Have you tried something like:
>
>
> rest("myapplication")
>
>    .id("MyRouteId")
>    .get("/{pathPram1}")
>    .outType(MyClass.class)
>    .to("direct:myroute")
>
> Regards.
>
>
> ________________________________
> De: Rajith Muditha Attapattu <[hidden email]>
> Enviado: jueves, 16 de febrero de 2017 18:05
> Para: [hidden email]
> Asunto: Setting a route-id for REST DSL routes
>
> I have a route as follows
>
> rest("myapplication")
>    .get("/{pathPram1}")
>    .outType(MyClass.class)
>    .to("direct:myroute")
>
> Camel by default adds a routeId to it as "routexx"
>
> I want to set a meaningful route-id to the above
> 1. To turn logging on off for certain routes.
> 2. When I look at the routes via JMX I can easily figure it out which one
> it is.
>
> Is there an easy way to accomplish the above?
>
> Regards,
>
> Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
> 2rlabs.com - This website is for sale! - 2rlabs Resources and
> Information.<http://rajith.2rlabs.com/>
> rajith.2rlabs.com
> This website is for sale! 2rlabs.com is your first and best source for
> all of the information you're looking for. From general topics to more of
> what you would expect to find here, 2rlabs.com has it all. We hope you
> find what you are searching for!
>
>
>
>


--
Regards,

Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
Reply | Threaded
Open this post in threaded view
|

Re: Setting a route-id for REST DSL routes

Claus Ibsen-2
It uses the id of the verb if you dont have an embedded route

get("xxx").id("myRouteIdHere")

On Thu, Feb 16, 2017 at 8:11 PM, Rajith Muditha Attapattu
<[hidden email]> wrote:

> That doesn't work due to not being in the API for the REST DSL.
> But you could do .route().routeId()
>
> Was expecting .routeId() to work directly or if there's something that we
> missed.
>
>
> On Thu, Feb 16, 2017 at 1:19 PM, Luis Javier Jiménez Ordás <
> [hidden email]> wrote:
>
>> Sorry, I meant
>>
>>
>> rest("myapplication")
>>
>>    .routeId("MyRouteId")
>>    .get("/{pathPram1}")
>>    .outType(MyClass.class)
>>    .to("direct:myroute")
>>
>> Regards.
>>
>> ________________________________
>> De: Luis Javier Jiménez Ordás <[hidden email]>
>> Enviado: jueves, 16 de febrero de 2017 18:18
>> Para: [hidden email]
>> Asunto: Re: Setting a route-id for REST DSL routes
>>
>>
>> Have you tried something like:
>>
>>
>> rest("myapplication")
>>
>>    .id("MyRouteId")
>>    .get("/{pathPram1}")
>>    .outType(MyClass.class)
>>    .to("direct:myroute")
>>
>> Regards.
>>
>>
>> ________________________________
>> De: Rajith Muditha Attapattu <[hidden email]>
>> Enviado: jueves, 16 de febrero de 2017 18:05
>> Para: [hidden email]
>> Asunto: Setting a route-id for REST DSL routes
>>
>> I have a route as follows
>>
>> rest("myapplication")
>>    .get("/{pathPram1}")
>>    .outType(MyClass.class)
>>    .to("direct:myroute")
>>
>> Camel by default adds a routeId to it as "routexx"
>>
>> I want to set a meaningful route-id to the above
>> 1. To turn logging on off for certain routes.
>> 2. When I look at the routes via JMX I can easily figure it out which one
>> it is.
>>
>> Is there an easy way to accomplish the above?
>>
>> Regards,
>>
>> Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
>> 2rlabs.com - This website is for sale! - 2rlabs Resources and
>> Information.<http://rajith.2rlabs.com/>
>> rajith.2rlabs.com
>> This website is for sale! 2rlabs.com is your first and best source for
>> all of the information you're looking for. From general topics to more of
>> what you would expect to find here, 2rlabs.com has it all. We hope you
>> find what you are searching for!
>>
>>
>>
>>
>
>
> --
> Regards,
>
> Rajith Muditha Attapattu <http://rajith.2rlabs.com/>



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Setting a route-id for REST DSL routes

rajith
Thanks Claus!

On Sat, Feb 18, 2017 at 3:41 AM, Claus Ibsen <[hidden email]> wrote:

> It uses the id of the verb if you dont have an embedded route
>
> get("xxx").id("myRouteIdHere")
>
> On Thu, Feb 16, 2017 at 8:11 PM, Rajith Muditha Attapattu
> <[hidden email]> wrote:
> > That doesn't work due to not being in the API for the REST DSL.
> > But you could do .route().routeId()
> >
> > Was expecting .routeId() to work directly or if there's something that we
> > missed.
> >
> >
> > On Thu, Feb 16, 2017 at 1:19 PM, Luis Javier Jiménez Ordás <
> > [hidden email]> wrote:
> >
> >> Sorry, I meant
> >>
> >>
> >> rest("myapplication")
> >>
> >>    .routeId("MyRouteId")
> >>    .get("/{pathPram1}")
> >>    .outType(MyClass.class)
> >>    .to("direct:myroute")
> >>
> >> Regards.
> >>
> >> ________________________________
> >> De: Luis Javier Jiménez Ordás <[hidden email]>
> >> Enviado: jueves, 16 de febrero de 2017 18:18
> >> Para: [hidden email]
> >> Asunto: Re: Setting a route-id for REST DSL routes
> >>
> >>
> >> Have you tried something like:
> >>
> >>
> >> rest("myapplication")
> >>
> >>    .id("MyRouteId")
> >>    .get("/{pathPram1}")
> >>    .outType(MyClass.class)
> >>    .to("direct:myroute")
> >>
> >> Regards.
> >>
> >>
> >> ________________________________
> >> De: Rajith Muditha Attapattu <[hidden email]>
> >> Enviado: jueves, 16 de febrero de 2017 18:05
> >> Para: [hidden email]
> >> Asunto: Setting a route-id for REST DSL routes
> >>
> >> I have a route as follows
> >>
> >> rest("myapplication")
> >>    .get("/{pathPram1}")
> >>    .outType(MyClass.class)
> >>    .to("direct:myroute")
> >>
> >> Camel by default adds a routeId to it as "routexx"
> >>
> >> I want to set a meaningful route-id to the above
> >> 1. To turn logging on off for certain routes.
> >> 2. When I look at the routes via JMX I can easily figure it out which
> one
> >> it is.
> >>
> >> Is there an easy way to accomplish the above?
> >>
> >> Regards,
> >>
> >> Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
> >> 2rlabs.com - This website is for sale! - 2rlabs Resources and
> >> Information.<http://rajith.2rlabs.com/>
> >> rajith.2rlabs.com
> >> This website is for sale! 2rlabs.com is your first and best source for
> >> all of the information you're looking for. From general topics to more
> of
> >> what you would expect to find here, 2rlabs.com has it all. We hope you
> >> find what you are searching for!
> >>
> >>
> >>
> >>
> >
> >
> > --
> > Regards,
> >
> > Rajith Muditha Attapattu <http://rajith.2rlabs.com/>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>



--
Regards,

Rajith Muditha Attapattu <http://rajith.2rlabs.com/>