Dynamic routing for backend micro services

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic routing for backend micro services

nishat
Hello Friends,

I have a requirement where my application is acting as a gateway and receive the viewid from the calling application. My application has to use this view id to get the endpoints for rest services form the database. The DB url keep changing so i have to be in sync with them.
Also i have to pre-process and post-process the headers and body before sending and receiving data form backend endpoint.

- How can i create dynamic endpoints with this information in DB?
- I see recipentList pattern but how can i pre-process and post-process the body of the message?

Kindly help.
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic routing for backend micro services

Claus Ibsen-2
You can do a route that does

from direct foo
   to bean pre process
   recipient list
   to bean post process



On Fri, Oct 28, 2016 at 7:41 PM, nishat <[hidden email]> wrote:

> Hello Friends,
>
> I have a requirement where my application is acting as a gateway and receive
> the viewid from the calling application. My application has to use this view
> id to get the endpoints for rest services form the database. The DB url keep
> changing so i have to be in sync with them.
> Also i have to pre-process and post-process the headers and body before
> sending and receiving data form backend endpoint.
>
> - How can i create dynamic endpoints with this information in DB?
> - I see recipentList pattern but how can i pre-process and post-process the
> body of the message?
>
> Kindly help.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dynamic-routing-for-backend-micro-services-tp5789412.html
> Sent from the Camel - Users mailing list archive at Nabble.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: Dynamic routing for backend micro services

nishat
Thabks for the response.

The problem is that I have to do something

from direct foo
   to bean pre process
   recipient list process message for each endpoint in recipient list and then process response from each end point and then aggregate all responses
   to bean post process

I don't know how to do the bold part.on above sequence. Also
My routes are not static they have to be generated from the endpoint's stored in db.


Kindly help.