public interface Endpoint extends IsSingleton, Service
Modifier and Type | Method and Description |
---|---|
void |
configureExchange(Exchange exchange)
Configures a newly created
Exchange . |
void |
configureProperties(Map<String,Object> options)
Configure properties on this endpoint.
|
AsyncProducer |
createAsyncProducer()
Creates a new producer which is used send messages into the endpoint
Important: Do not do any initialization in the constructor of the
Producer . |
Consumer |
createConsumer(Processor processor)
Creates a new Event Driven Consumer which
consumes messages from the endpoint using the given processor
Important: Do not do any initialization in the constructor of the
Consumer . |
Exchange |
createExchange()
Create a new exchange for communicating with this endpoint.
|
Exchange |
createExchange(ExchangePattern pattern)
Create a new exchange for communicating with this endpoint with the specified
ExchangePattern such as
whether its going to be an ExchangePattern.InOnly or ExchangePattern.InOut exchange
Important: Consumers should use Consumer.createExchange(boolean) to create an exchange for which
the consumer received a message. |
PollingConsumer |
createPollingConsumer()
Creates a new Polling Consumer so that the caller can
poll message exchanges from the consumer using
PollingConsumer.receive() ,
PollingConsumer.receiveNoWait() or PollingConsumer.receive(long) whenever it is ready to do so
rather than using the Event Based Consumer
returned by createConsumer(Processor)
Important: Do not do any initialization in the constructor of the PollingConsumer . |
Producer |
createProducer()
Creates a new producer which is used send messages into the endpoint.
|
CamelContext |
getCamelContext()
Returns the context which created the endpoint
|
default String |
getEndpointBaseUri()
Returns the string representation of the base endpoint URI (without query parameters).
|
String |
getEndpointKey()
Returns a string key of this endpoint.
|
String |
getEndpointUri()
Returns the string representation of the endpoint URI
|
ExchangePattern |
getExchangePattern()
Returns the default exchange pattern to use when creating an exchange.
|
boolean |
isLenientProperties()
Should all properties be known or does the endpoint allow unknown options?
lenient = false means that the endpoint should validate that all given options is known and configured
properly.
|
default boolean |
isSingletonProducer()
Whether this endpoint creates singleton producers
|
void |
setCamelContext(CamelContext context)
Sets the camel context.
|
isSingleton, test
String getEndpointUri()
ExchangePattern getExchangePattern()
default String getEndpointBaseUri()
String getEndpointKey()
LifecycleStrategy
when registering endpoint. This allows to
register different instances of endpoints with the same key.
For JMX mbeans this allows us to use the same JMX Mbean for all endpoints that are logical the same but have
different parameters. For instance the http endpoint.Exchange createExchange()
Consumer.createExchange(boolean)
to create an exchange for which
the consumer received a message.Exchange createExchange(ExchangePattern pattern)
ExchangePattern
such as
whether its going to be an ExchangePattern.InOnly
or ExchangePattern.InOut
exchange
Important: Consumers should use Consumer.createExchange(boolean)
to create an exchange for which
the consumer received a message.pattern
- the message exchange pattern for the exchangevoid configureExchange(Exchange exchange)
Exchange
.exchange
- the new exchangeCamelContext getCamelContext()
Producer createProducer() throws Exception
Producer
. Instead use
BaseService.doInit()
or BaseService.doStart()
.Exception
- can be throwndefault boolean isSingletonProducer()
AsyncProducer createAsyncProducer() throws Exception
Producer
. Instead use
BaseService.doInit()
or BaseService.doStart()
.Exception
- can be thrownConsumer createConsumer(Processor processor) throws Exception
Consumer
. Instead use
BaseService.doInit()
or BaseService.doStart()
.processor
- the given processorException
- can be thrownPollingConsumer createPollingConsumer() throws Exception
PollingConsumer.receive()
,
PollingConsumer.receiveNoWait()
or PollingConsumer.receive(long)
whenever it is ready to do so
rather than using the Event Based Consumer
returned by createConsumer(Processor)
Important: Do not do any initialization in the constructor of the PollingConsumer
. Instead use
BaseService.doInit()
or BaseService.doStart()
.Exception
- if the pull consumer could not be createdvoid configureProperties(Map<String,Object> options)
options
- the options (properties)void setCamelContext(CamelContext context)
context
- the camel contextboolean isLenientProperties()
Apache Camel