Interface RestProducerFactory
public interface RestProducerFactory
SPI that creates the Camel
Producer responsible for performing HTTP requests to call a
remote REST service.
Implementations are provided by HTTP-capable Camel components such as camel-http, camel-netty-http,
and camel-vertx-http. At runtime, CamelContext selects the active implementation
from the registry using the producer component name configured in RestConfiguration. The single
createProducer(CamelContext, String, String, String, String, String, String, String, RestConfiguration, Map) method receives the full invocation contract: target host (scheme:host:port), HTTP verb, base
path, URI template, query parameters, accepted and produced media types, the shared RestConfiguration, and
any additional component-specific parameters.
See Rest DSL in the Camel user manual.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateProducer(CamelContext camelContext, String host, String verb, String basePath, @Nullable String uriTemplate, @Nullable String queryParameters, @Nullable String consumes, @Nullable String produces, RestConfiguration configuration, Map<String, Object> parameters) Creates a new REST producer.
-
Method Details
-
createProducer
Producer createProducer(CamelContext camelContext, String host, String verb, String basePath, @Nullable String uriTemplate, @Nullable String queryParameters, @Nullable String consumes, @Nullable String produces, RestConfiguration configuration, Map<String, Object> parameters) throws ExceptionCreates a new REST producer.- Parameters:
camelContext- the camel contexthost- host in the syntax scheme:hostname:port, such as http:myserver:8080verb- HTTP verb such as GET, POSTbasePath- base pathuriTemplate- uri templatequeryParameters- uri query parametersconsumes- media-types for what the REST service consume as input (accept-type), is null or */* for anythingproduces- media-types for what the REST service produces as output, can be nullconfiguration- REST configurationparameters- additional parameters- Returns:
- a newly created REST producer
- Throws:
Exception- can be thrown
-