RestConfiguration with multiple ports

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

RestConfiguration with multiple ports

dfullarton
I know that via netty4-http I'm able to create multiple HTTP listeners on multiple ports.

 from("netty4-http:http://localhost:8088").to(...)
 from("netty4-http:http://localhost:8087").to(...)

but when using rest configuration it seems I'm limited to the one listener

restConfiguration().component("netty4-http")...

Is there a way (within one context) that I can bring up multiple http listeners and route them through to routes create by rest(PATH)?
Reply | Threaded
Open this post in threaded view
|

Re: RestConfiguration with multiple ports

Claus Ibsen-2
Hi

Do you want to have different rest services for different ports? Or do
some of the rest services share the ports?

Either way its not currently baked in too well in the rest-dsl to
allow to pick which rest configuration to user per service.
The design was to keep it simple, 1 rest component for all the services.




On Fri, Jan 15, 2016 at 12:00 AM, dfullarton <[hidden email]> wrote:

> I know that via netty4-http I'm able to create multiple HTTP listeners on
> multiple ports.
>
>  from("netty4-http:http://localhost:8088").to(...)
>  from("netty4-http:http://localhost:8087").to(...)
>
> but when using rest configuration it seems I'm limited to the one listener
>
> restConfiguration().component("netty4-http")...
>
> Is there a way (within one context) that I can bring up multiple http
> listeners and route them through to routes create by rest(PATH)?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/RestConfiguration-with-multiple-ports-tp5776265.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: RestConfiguration with multiple ports

dfullarton
Thanks Claus,

I was looking to mock different services on different ports in the same context. Completely understand this is a bit of an edge case and it makes sense it's not baked in.

If you have any suggests on where to look in order to achieve this I'd still like to give it a shot.
Reply | Threaded
Open this post in threaded view
|

Re: RestConfiguration with multiple ports

Claus Ibsen-2
As part of testing or to mock them in a real life situation?

On Fri, Jan 15, 2016 at 12:42 PM, dfullarton <[hidden email]> wrote:

> Thanks Claus,
>
> I was looking to mock different services on different ports in the same
> context. Completely understand this is a bit of an edge case and it makes
> sense it's not baked in.
>
> If you have any suggests on where to look in order to achieve this I'd still
> like to give it a shot.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/RestConfiguration-with-multiple-ports-tp5776265p5776296.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: RestConfiguration with multiple ports

dfullarton
Testing
Reply | Threaded
Open this post in threaded view
|

Re: RestConfiguration with multiple ports

jjathman
Is this something that is possible? I'm looking to do the same thing. We would like to have internal traffic run on a separate port from the externally visible port to make firewall rules easier. Is this something that is possible?

I have defined two separate RouteBuilder classes each with their own restConfiguration running on different ports, but at runtime they just end up using the same port.