You are viewing an older version of this section. Click here to navigate to the latest version.

REST Component Reference


REST Component Reference

Purpose: Use a REST API to publish an external RESTful web service.

Minimum Configuration: Specify the REST component or resource class.

Discussion: A REST component publishes a RESTful web service via JAX-RS annotations and using Jersey. In addition to specifying the REST component class, you can also configure an exception mapper and a interceptor.

Note that REST is a formal HTTP architecture based on resources, links, and a uniform interface. As such, it uses the HTTP protocol.

Mule hosts RESTful web services using Jersey, which is a JAX-RS (JSR-311) implementation. JAX-RS is a specification that provides a series of annotations and classes that make it possible to build RESTful services.

Generally, you add a REST component to an endpoint. If you add the REST component to a request-response endpoint, such as an HTTP endpoint, Mule Studio generates a REST request-response component, as shown below.


If you add the REST component to a one-way endpoint, such as a File endpoint, then Mule Studio generates a REST one-way component. See below.


Double-click the REST icon on the canvas to open the Pattern Properties dialog. Use the General tab to specify the reference to the REST component or resource and, if you are using exception mapping, the class implementing this mapping.

Use the Advanced tab to specify a reference to an interceptor. When you add a new interceptor, use the pull-down menu to specify whether this is a custom interceptor, a logging interceptor, or a timer interceptor.