Blessed Geek
Blessed Geek

Reputation: 21614

Is the Camel Rest Component for setting up the service client or service provider?

WRT http://camel.apache.org/rest.html.

  1. Is this component used by the client to set-up endpoint to reach an existent server?

    • if so, does it mean camel provides me more than one way to do it? Should I be using http component .to("http://endpointuri") instead?
    • What is the advantage of client using rest component over http component?

    Or

  2. used by the service provider to set-up the service provider??

    • if so, does this mean camel provides me more than one way to do it? Refer to http://camel.apache.org/rest-dsl.html .
    • What is the advantage of client using rest component over http-dsl?

1 or 2? For use by client or server? As usual, the camel docs has unspecified indirection.

Upvotes: 0

Views: 97

Answers (1)

Souciance Eqdam Rashti
Souciance Eqdam Rashti

Reputation: 3193

  1. This component allows Camel to expose REST services. These services will be invoked by your client. In the internal processing of a service you can do anything you want like calling other services. The DSL relies on underlying http components so you can use undertow, jetty, netty and others to set this up.

  2. There is no such thing as a http-dsl. Essentially you use the rest-dsl together with some http framework such as undertow to expose some REST services. The DSL makes the creation of the REST services easier. I think it can also generate swagger docs for you.

Upvotes: 1

Related Questions