public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type>> extends OptionalIdentifiedDefinition<Type> implements Block
Modifier and Type | Field and Description |
---|---|
protected Boolean |
inheritErrorHandler |
protected org.slf4j.Logger |
log |
Modifier | Constructor and Description |
---|---|
protected |
ProcessorDefinition() |
Modifier and Type | Method and Description |
---|---|
protected void |
addInterceptStrategies(RouteContext routeContext,
Channel channel,
List<InterceptStrategy> strategies)
Adds the given list of interceptors to the channel.
|
void |
addInterceptStrategy(InterceptStrategy strategy) |
void |
addOutput(ProcessorDefinition<?> output)
Adds the given definition as output to this block
|
void |
addRoutes(RouteContext routeContext,
Collection<Route> routes) |
ExpressionClause<AggregateDefinition> |
aggregate()
Aggregator EIP:
Creates an aggregator allowing you to combine a number of messages together into a single message.
|
ExpressionClause<AggregateDefinition> |
aggregate(AggregationStrategy aggregationStrategy)
Aggregator EIP:
Creates an aggregator allowing you to combine a number of messages together into a single message.
|
AggregateDefinition |
aggregate(Expression correlationExpression)
Aggregator EIP:
Creates an aggregator allowing you to combine a number of messages together into a single message.
|
AggregateDefinition |
aggregate(Expression correlationExpression,
AggregationStrategy aggregationStrategy)
Aggregator EIP:
Creates an aggregator allowing you to combine a number of messages together into a single message.
|
AOPDefinition |
aop()
Deprecated.
to be removed in the near future. Instead you can use interceptors or processors to do AOP with Camel.
|
Type |
attribute(QName name,
Object value)
Adds an optional attribute
|
Type |
bean(Class<?> beanType)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
bean(Class<?> beanType,
String method)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
bean(Class<?> beanType,
String method,
boolean multiParameterArray)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
bean(Class<?> beanType,
String method,
boolean multiParameterArray,
boolean cache)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
bean(Object bean)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
bean(Object bean,
String method)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
bean(Object bean,
String method,
boolean multiParameterArray)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
beanRef(String ref)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
beanRef(String ref,
boolean cache)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
beanRef(String ref,
String method)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
beanRef(String ref,
String method,
boolean cache)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
Type |
beanRef(String ref,
String method,
boolean cache,
boolean multiParameterArray)
Message Translator EIP:
Adds a bean which is invoked which could be a final destination, or could be a transformation in a pipeline
|
ChoiceDefinition |
choice()
Content Based Router EIP:
Creates a choice of one or more predicates with an otherwise clause
|
void |
clearOutput() |
void |
configureChild(ProcessorDefinition<?> output)
Strategy for children to do any custom configuration
|
Type |
convertBodyTo(Class<?> type)
Converts the IN message body to the specified type
|
Type |
convertBodyTo(Class<?> type,
String charset)
Converts the IN message body to the specified type
|
protected ModelChannel |
createChannel(RouteContext routeContext)
Creates a new instance of the
Channel . |
Processor |
createChildProcessor(RouteContext routeContext,
boolean mandatory)
Creates the child processor (outputs) from the current definition
|
protected Processor |
createCompositeProcessor(RouteContext routeContext,
List<Processor> list)
Creates a new instance of some kind of composite processor which defaults
to using a
Pipeline but derived classes could change the behaviour |
Processor |
createOutputsProcessor(RouteContext routeContext)
Prefer to use {#link #createChildProcessor}.
|
protected Processor |
createOutputsProcessor(RouteContext routeContext,
Collection<ProcessorDefinition<?>> outputs) |
Processor |
createProcessor(RouteContext routeContext)
Override this in definition class and implement logic to create the processor
based on the definition model.
|
protected Processor |
createProcessor(RouteContext routeContext,
ProcessorDefinition<?> output) |
ExpressionClause<DelayDefinition> |
delay()
Delayer EIP:
Creates a delayer allowing you to delay the delivery of messages to some destination.
|
DelayDefinition |
delay(Expression delay)
Delayer EIP:
Creates a delayer allowing you to delay the delivery of messages to some destination.
|
DelayDefinition |
delay(long delay)
Delayer EIP:
Creates a delayer allowing you to delay the delivery of messages to some destination.
|
TryDefinition |
doTry()
Creates a try/catch block
|
ExpressionClause<DynamicRouterDefinition<Type>> |
dynamicRouter()
Dynamic Router EIP:
Creates a dynamic router allowing you to route a message consecutively through a series of processing
steps where the sequence of steps is not known at design time and can vary for each message.
|
DynamicRouterDefinition<Type> |
dynamicRouter(Expression expression)
Dynamic Router EIP:
Creates a dynamic router allowing you to route a message consecutively through a series of processing
steps where the sequence of steps is not known at design time and can vary for each message.
|
ProcessorDefinition<?> |
end()
Ends the current block
|
ChoiceDefinition |
endChoice()
Ends the current block and returns back to the
choice() DSL. |
TryDefinition |
endDoTry()
Ends the current block and returns back to the
doTry() DSL. |
ProcessorDefinition<?> |
endParent()
Strategy to allow
ProcessorDefinition s to have special logic when using end() in the DSL
to return back to the intended parent. |
RestDefinition |
endRest()
Ends the current block and returns back to the
rest() DSL. |
Type |
enrich(String resourceUri)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri . |
Type |
enrich(String resourceUri,
AggregationStrategy aggregationStrategy)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri . |
Type |
enrich(String resourceUri,
AggregationStrategy aggregationStrategy,
boolean aggregateOnException)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri . |
Type |
enrichRef(String resourceRef,
String aggregationStrategyRef)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri . |
Type |
enrichRef(String resourceRef,
String aggregationStrategyRef,
boolean aggregateOnException)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri . |
ExpressionClause<? extends FilterDefinition> |
filter()
Message Filter EIP:
Creates a predicate expression which only if it is true then the
exchange is forwarded to the destination
|
FilterDefinition |
filter(ExpressionDefinition expression)
Message Filter EIP:
Creates a predicate expression which only if it is true then the
exchange is forwarded to the destination
|
FilterDefinition |
filter(Predicate predicate)
Message Filter EIP:
Creates a predicate which is applied and only if it is true then the
exchange is forwarded to the destination
|
FilterDefinition |
filter(String language,
String expression)
Message Filter EIP:
Creates a predicate language expression which only if it is true then the
exchange is forwarded to the destination
|
int |
getIndex()
Gets the unique index number for when this
ProcessorDefinition was created by its constructor. |
List<InterceptStrategy> |
getInterceptStrategies() |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node
|
Map<QName,Object> |
getOtherAttributes() |
abstract List<ProcessorDefinition<?>> |
getOutputs() |
ProcessorDefinition<?> |
getParent() |
Type |
id(String id)
Sets the id of this node.
|
IdempotentConsumerDefinition |
idempotentConsumer(Expression messageIdExpression)
Idempotent consumer EIP:
Creates an
IdempotentConsumer
to avoid duplicate messages |
IdempotentConsumerDefinition |
idempotentConsumer(Expression messageIdExpression,
IdempotentRepository<?> idempotentRepository)
Idempotent consumer EIP:
Creates an
IdempotentConsumer
to avoid duplicate messages |
ExpressionClause<IdempotentConsumerDefinition> |
idempotentConsumer(IdempotentRepository<?> idempotentRepository)
Deprecated.
will be removed in Camel 3.0. Instead use any of the other methods
|
Type |
inheritErrorHandler(boolean inheritErrorHandler)
Sets whether or not to inherit the configured error handler.
|
Type |
inOnly()
Deprecated.
|
Type |
inOnly(Endpoint... endpoints)
Sends the message to the given endpoints using an
Event Message or
InOnly exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOnly(Endpoint endpoint)
Sends the message to the given endpoint using an
Event Message or
InOnly exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOnly(Iterable<Endpoint> endpoints)
Sends the message to the given endpoints using an
Event Message or
InOnly exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOnly(String... uris)
Sends the message to the given endpoints using an
Event Message or
InOnly exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOnly(String uri)
Sends the message to the given endpoint using an
Event Message or
InOnly exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOut()
Deprecated.
|
Type |
inOut(Endpoint... endpoints)
Sends the message to the given endpoints using an
Request Reply or
InOut exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOut(Endpoint endpoint)
Sends the message to the given endpoint using an
Request Reply or
InOut exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOut(Iterable<Endpoint> endpoints)
Sends the message to the given endpoints using an
Request Reply or
InOut exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOut(String... uris)
Sends the message to the given endpoints using an
Request Reply or
InOut exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
Type |
inOut(String uri)
Sends the message to the given endpoint using an
Request Reply or
InOut exchange pattern
Notice the existing MEP is restored after the message has been sent to the given endpoint.
|
boolean |
isAbstract()
Whether this model is abstract or not.
|
Boolean |
isInheritErrorHandler() |
abstract boolean |
isOutputSupported() |
boolean |
isTopLevelOnly()
Whether this definition can only be added as top-level directly on the route itself (such as onException,onCompletion,intercept, etc.)
If trying to add a top-level only definition to a nested output would fail in the
addOutput(ProcessorDefinition)
method. |
LoadBalanceDefinition |
loadBalance()
Load Balancer EIP:
Creates a loadbalance
|
LoadBalanceDefinition |
loadBalance(LoadBalancer loadBalancer)
Load Balancer EIP:
Creates a loadbalance
|
Type |
log(LoggingLevel loggingLevel,
org.slf4j.Logger logger,
String message)
Creates a log message to be logged at the given level using provided logger.
|
Type |
log(LoggingLevel loggingLevel,
org.slf4j.Logger logger,
String marker,
String message)
Creates a log message to be logged at the given level using provided logger.
|
Type |
log(LoggingLevel loggingLevel,
String message)
Creates a log message to be logged at the given level.
|
Type |
log(LoggingLevel loggingLevel,
String logName,
String message)
Creates a log message to be logged at the given level and name.
|
Type |
log(LoggingLevel loggingLevel,
String logName,
String marker,
String message)
Creates a log message to be logged at the given level and name.
|
Type |
log(String message)
Creates a log message to be logged at INFO level.
|
ExpressionClause<LoopDefinition> |
loop()
Loop EIP:
Creates a loop allowing to process the a message a number of times and possibly process them
in a different way.
|
LoopDefinition |
loop(Expression expression)
Loop EIP:
Creates a loop allowing to process the a message a number of times and possibly process them
in a different way.
|
LoopDefinition |
loop(int count)
Loop EIP:
Creates a loop allowing to process the a message a number of times and possibly process them
in a different way.
|
protected Processor |
makeProcessor(RouteContext routeContext)
Creates the processor and wraps it in any necessary interceptors and error handlers
|
Type |
markRollbackOnly()
Marks the exchange for rollback only.
|
Type |
markRollbackOnlyLast()
Marks the exchange for rollback only, but only for the last (current) transaction.
|
DataFormatClause<ProcessorDefinition<Type>> |
marshal()
DataFormat:
Marshals the in body using a
DataFormat expression to define
the format of the output which will be added to the out body. |
Type |
marshal(DataFormat dataFormat)
DataFormat:
Marshals the in body using the specified
DataFormat
and sets the output on the out message body. |
Type |
marshal(DataFormatDefinition dataFormatType)
DataFormat:
Marshals the in body using the specified
DataFormat
and sets the output on the out message body. |
Type |
marshal(String dataTypeRef)
DataFormat:
Marshals the in body the specified
DataFormat
reference in the Registry and sets
the output on the out message body. |
MulticastDefinition |
multicast()
Multicast EIP:
Multicasts messages to all its child outputs; so that each processor and
destination gets a copy of the original message to avoid the processors
interfering with each other.
|
MulticastDefinition |
multicast(AggregationStrategy aggregationStrategy)
Multicast EIP:
Multicasts messages to all its child outputs; so that each processor and
destination gets a copy of the original message to avoid the processors
interfering with each other.
|
MulticastDefinition |
multicast(AggregationStrategy aggregationStrategy,
boolean parallelProcessing)
Multicast EIP:
Multicasts messages to all its child outputs; so that each processor and
destination gets a copy of the original message to avoid the processors
interfering with each other.
|
OnCompletionDefinition |
onCompletion()
Adds a onComplection
Synchronization hook that invoke this route as
a callback when the Exchange has finished being processed. |
OnExceptionDefinition |
onException(Class<? extends Throwable>... exceptions)
Exception clause
for catching certain exceptions and handling them.
|
OnExceptionDefinition |
onException(Class<? extends Throwable> exceptionType)
Exception clause
for catching certain exceptions and handling them.
|
PipelineDefinition |
pipeline()
Pipes and Filters EIP:
Creates a
Pipeline so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpoint |
Type |
pipeline(Collection<Endpoint> endpoints)
Pipes and Filters EIP:
Creates a
Pipeline of the list of endpoints so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpoint |
Type |
pipeline(Endpoint... endpoints)
Pipes and Filters EIP:
Creates a
Pipeline of the list of endpoints so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpoint |
Type |
pipeline(String... uris)
Pipes and Filters EIP:
Creates a
Pipeline of the list of endpoints so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpoint |
Type |
placeholder(String option,
String key)
Adds a placeholder for the given option
Requires using the
PropertiesComponent |
PolicyDefinition |
policy(Policy policy)
Apply a
Policy . |
PolicyDefinition |
policy(String ref)
Apply a
Policy . |
Type |
pollEnrich(String resourceUri)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri
using a PollingConsumer to poll the endpoint. |
Type |
pollEnrich(String resourceUri,
AggregationStrategy aggregationStrategy)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri
using a PollingConsumer to poll the endpoint. |
Type |
pollEnrich(String resourceUri,
long timeout)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri
using a PollingConsumer to poll the endpoint. |
Type |
pollEnrich(String resourceUri,
long timeout,
AggregationStrategy aggregationStrategy)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri
using a PollingConsumer to poll the endpoint. |
Type |
pollEnrich(String resourceUri,
long timeout,
AggregationStrategy aggregationStrategy,
boolean aggregateOnException)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri
using a PollingConsumer to poll the endpoint. |
Type |
pollEnrichRef(String resourceRef,
long timeout,
String aggregationStrategyRef)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri
using a PollingConsumer to poll the endpoint. |
Type |
pollEnrichRef(String resourceRef,
long timeout,
String aggregationStrategyRef,
boolean aggregateOnException)
The Content Enricher EIP
enriches an exchange with additional data obtained from a
resourceUri
using a PollingConsumer to poll the endpoint. |
protected void |
preCreateProcessor()
Strategy to execute any custom logic before the
Processor is created. |
Type |
process(Processor processor)
Message Translator EIP:
Adds the custom processor to this destination which could be a final
destination, or could be a transformation in a pipeline
|
Type |
processRef(String ref)
Message Translator EIP:
Adds the custom processor reference to this destination which could be a final
destination, or could be a transformation in a pipeline
|
ExpressionClause<RecipientListDefinition<Type>> |
recipientList()
Recipient List EIP:
Creates a dynamic recipient list allowing you to route messages to a number of dynamically specified recipients
|
RecipientListDefinition<Type> |
recipientList(Expression recipients)
Recipient List EIP:
Creates a dynamic recipient list allowing you to route messages to a number of dynamically specified recipients.
|
RecipientListDefinition<Type> |
recipientList(Expression recipients,
String delimiter)
Recipient List EIP:
Creates a dynamic recipient list allowing you to route messages to a number of dynamically specified recipients
|
ExpressionClause<RecipientListDefinition<Type>> |
recipientList(String delimiter)
Recipient List EIP:
Creates a dynamic recipient list allowing you to route messages to a number of dynamically specified recipients
|
Type |
removeFaultHeader(String name)
Deprecated.
will be removed in the near future. Instead use
removeHeader(String) |
Type |
removeHeader(String name)
Adds a processor which removes the header on the IN message
|
Type |
removeHeaders(String pattern)
Adds a processor which removes the headers on the IN message
|
Type |
removeHeaders(String pattern,
String... excludePatterns)
Adds a processor which removes the headers on the IN message
|
Type |
removeProperty(String name)
Adds a processor which removes the exchange property
|
ExpressionClause<ResequenceDefinition> |
resequence()
Resequencer EIP:
Creates a resequencer allowing you to reorganize messages based on some comparator.
|
ResequenceDefinition |
resequence(Expression expression)
Resequencer EIP:
Creates a resequencer allowing you to reorganize messages based on some comparator.
|
Type |
rollback()
Marks the exchange for rollback only and sets an exception with a default message.
|
Type |
rollback(String message)
Marks the exchange for rollback and sets an exception with the provided message.
|
Type |
routeId(String id)
Set the route id for this route.
|
ExpressionClause<RoutingSlipDefinition<Type>> |
routingSlip()
Routing Slip EIP:
Creates a routing slip allowing you to route a message consecutively through a series of processing
steps where the sequence of steps is not known at design time and can vary for each message.
|
RoutingSlipDefinition<Type> |
routingSlip(Expression expression)
Routing Slip EIP:
Creates a routing slip allowing you to route a message consecutively through a series of processing
steps where the sequence of steps is not known at design time and can vary for each message.
|
RoutingSlipDefinition<Type> |
routingSlip(Expression expression,
String uriDelimiter)
Routing Slip EIP:
Creates a routing slip allowing you to route a message consecutively through a series of processing
steps where the sequence of steps is not known at design time and can vary for each message.
|
Type |
routingSlip(String header)
Deprecated.
prefer to use
routingSlip(org.apache.camel.Expression) instead |
Type |
routingSlip(String header,
boolean ignoreInvalidEndpoints)
Deprecated.
prefer to use
routingSlip() instead |
Type |
routingSlip(String header,
String uriDelimiter)
Deprecated.
prefer to use
routingSlip(org.apache.camel.Expression, String) instead |
Type |
routingSlip(String header,
String uriDelimiter,
boolean ignoreInvalidEndpoints)
Deprecated.
prefer to use
routingSlip() instead |
SamplingDefinition |
sample()
Sampling Throttler
Creates a sampling throttler allowing you to extract a sample of
exchanges from the traffic on a route.
|
SamplingDefinition |
sample(long messageFrequency)
Sampling Throttler
Creates a sampling throttler allowing you to extract a sample of exchanges
from the traffic through a route.
|
SamplingDefinition |
sample(long samplePeriod,
TimeUnit unit)
Sampling Throttler
Creates a sampling throttler allowing you to extract a sample of exchanges
from the traffic through a route.
|
ExpressionClause<ProcessorDefinition<Type>> |
setBody()
Message Translator EIP:
Adds a processor which sets the body on the IN message
|
Type |
setBody(Expression expression)
Message Translator EIP:
Adds a processor which sets the body on the IN message
|
Type |
setExchangePattern(ExchangePattern exchangePattern)
|
Type |
setFaultBody(Expression expression)
Adds a processor which sets the body on the FAULT message
|
Type |
setFaultHeader(String name,
Expression expression)
Deprecated.
|
ExpressionClause<ProcessorDefinition<Type>> |
setHeader(String name)
Adds a processor which sets the header on the IN message
|
Type |
setHeader(String name,
Expression expression)
Adds a processor which sets the header on the IN message
|
void |
setInheritErrorHandler(Boolean inheritErrorHandler) |
void |
setOtherAttributes(Map<QName,Object> otherAttributes) |
ExpressionClause<ProcessorDefinition<Type>> |
setOutHeader(String name)
Deprecated.
|
Type |
setOutHeader(String name,
Expression expression)
Deprecated.
|
void |
setParent(ProcessorDefinition<?> parent) |
ExpressionClause<ProcessorDefinition<Type>> |
setProperty(String name)
Adds a processor which sets the exchange property
|
Type |
setProperty(String name,
Expression expression)
Adds a processor which sets the exchange property
|
<T> ExpressionClause<SortDefinition<T>> |
sort()
Sorts the expression
|
Type |
sort(Expression expression)
Sorts the expression using a default sorting based on toString representation.
|
<T> Type |
sort(Expression expression,
Comparator<T> comparator)
Sorts the expression using the given comparator
|
ExpressionClause<SplitDefinition> |
split()
Splitter EIP:
Creates a splitter allowing you split a message into a number of pieces and process them individually.
|
SplitDefinition |
split(Expression expression)
Splitter EIP:
Creates a splitter allowing you split a message into a number of pieces and process them individually.
|
SplitDefinition |
split(Expression expression,
AggregationStrategy aggregationStrategy)
Splitter EIP:
Creates a splitter allowing you split a message into a number of pieces and process them individually.
|
Type |
startupOrder(int startupOrder) |
Type |
stop()
Stops continue routing the current
Exchange and marks it as completed. |
ThreadsDefinition |
threads()
Continues processing the
Exchange using asynchronous routing engine. |
ThreadsDefinition |
threads(int poolSize)
Continues processing the
Exchange using asynchronous routing engine. |
ThreadsDefinition |
threads(int poolSize,
int maxPoolSize)
Continues processing the
Exchange using asynchronous routing engine. |
ThreadsDefinition |
threads(int poolSize,
int maxPoolSize,
String threadName)
Continues processing the
Exchange using asynchronous routing engine. |
ThrottleDefinition |
throttle(Expression maximumRequestCount)
Throttler EIP:
Creates a throttler allowing you to ensure that a specific endpoint does not get overloaded,
or that we don't exceed an agreed SLA with some external service.
|
ThrottleDefinition |
throttle(long maximumRequestCount)
Throttler EIP:
Creates a throttler allowing you to ensure that a specific endpoint does not get overloaded,
or that we don't exceed an agreed SLA with some external service.
|
Type |
throwException(Exception exception)
Sets the exception on the
Exchange |
Type |
to(Endpoint... endpoints)
Sends the exchange to a list of endpoints
|
Type |
to(Endpoint endpoint)
Sends the exchange to the given endpoint
|
Type |
to(ExchangePattern pattern,
Endpoint... endpoints)
Sends the exchange to a list of endpoints
Notice the existing MEP is preserved
|
Type |
to(ExchangePattern pattern,
Endpoint endpoint)
Sends the exchange with certain exchange pattern to the given endpoint
Notice the existing MEP is preserved
|
Type |
to(ExchangePattern pattern,
Iterable<Endpoint> endpoints)
Sends the exchange to a list of endpoints
|
Type |
to(ExchangePattern pattern,
String... uris)
Sends the exchange to a list of endpoints
Notice the existing MEP is preserved
|
Type |
to(ExchangePattern pattern,
String uri)
Sends the exchange with certain exchange pattern to the given endpoint
Notice the existing MEP is preserved
|
Type |
to(Iterable<Endpoint> endpoints)
Sends the exchange to a list of endpoints
|
Type |
to(String... uris)
Sends the exchange to a list of endpoints
|
Type |
to(String uri)
Sends the exchange to the given endpoint
|
Type |
toF(String uri,
Object... args)
Sends the exchange to the given endpoint
|
TransactedDefinition |
transacted()
Marks this route as transacted and uses the default transacted policy found in the registry.
|
TransactedDefinition |
transacted(String ref)
Marks this route as transacted.
|
ExpressionClause<ProcessorDefinition<Type>> |
transform()
Message Translator EIP:
Adds a processor which sets the body on the OUT message
|
Type |
transform(Expression expression)
Message Translator EIP:
Adds a processor which sets the body on the OUT message
|
DataFormatClause<ProcessorDefinition<Type>> |
unmarshal()
DataFormat:
Unmarshals the in body using a
DataFormat expression to define
the format of the input message and the output will be set on the out message body. |
Type |
unmarshal(DataFormat dataFormat)
DataFormat:
Unmarshals the in body using the specified
DataFormat
and sets the output on the out message body. |
Type |
unmarshal(DataFormatDefinition dataFormatType)
DataFormat:
Unmarshals the in body using the specified
DataFormat
and sets the output on the out message body. |
Type |
unmarshal(String dataTypeRef)
DataFormat:
Unmarshals the in body using the specified
DataFormat
reference in the Registry and sets
the output on the out message body. |
ExpressionClause<ValidateDefinition> |
validate()
Creates a validation expression which only if it is true then the
exchange is forwarded to the destination.
|
ValidateDefinition |
validate(Expression expression)
Creates a validation expression which only if it is true then the
exchange is forwarded to the destination.
|
ValidateDefinition |
validate(Predicate predicate)
Creates a validation expression which only if it is true then the
exchange is forwarded to the destination.
|
WireTapDefinition<Type> |
wireTap(String uri)
WireTap EIP:
Sends messages to all its child outputs; so that each processor and
destination gets a copy of the original message to avoid the processors
interfering with each other using
ExchangePattern.InOnly . |
WireTapDefinition<Type> |
wireTap(String uri,
boolean copy,
Expression body)
Deprecated.
use the fluent builder from
WireTapDefinition , will be removed in Camel 3.0 |
WireTapDefinition<Type> |
wireTap(String uri,
boolean copy,
Processor processor)
Deprecated.
use the fluent builder from
WireTapDefinition , will be removed in Camel 3.0 |
WireTapDefinition<Type> |
wireTap(String uri,
ExecutorService executorService)
Deprecated.
use the fluent builder from
WireTapDefinition , will be removed in Camel 3.0 |
WireTapDefinition<Type> |
wireTap(String uri,
Expression body)
Deprecated.
use the fluent builder from
WireTapDefinition , will be removed in Camel 3.0 |
WireTapDefinition<Type> |
wireTap(String uri,
Processor processor)
Deprecated.
use the fluent builder from
WireTapDefinition , will be removed in Camel 3.0 |
WireTapDefinition<Type> |
wireTap(String uri,
String executorServiceRef)
Deprecated.
use the fluent builder from
WireTapDefinition , will be removed in Camel 3.0 |
protected Processor |
wrapChannel(RouteContext routeContext,
Processor processor,
ProcessorDefinition<?> child) |
protected Processor |
wrapInErrorHandler(RouteContext routeContext,
Processor output)
Wraps the given output in an error handler
|
Processor |
wrapProcessor(RouteContext routeContext,
Processor processor)
Wraps the child processor in whatever necessary interceptors and error handlers
|
description, description, getDescription, getDescriptionText, getId, getShortName, hasCustomIdAssigned, idOrCreate, isCustomId, setCustomId, setDescription, setId
protected final org.slf4j.Logger log
protected Boolean inheritErrorHandler
protected ProcessorDefinition()
public int getIndex()
ProcessorDefinition
was created by its constructor.
This can be used to know the order in which the definition was created when assembled as a route.public abstract List<ProcessorDefinition<?>> getOutputs()
public abstract boolean isOutputSupported()
public boolean isTopLevelOnly()
addOutput(ProcessorDefinition)
method.public boolean isAbstract()
public Processor createProcessor(RouteContext routeContext) throws Exception
Exception
public Processor createOutputsProcessor(RouteContext routeContext) throws Exception
Exception
public Processor createChildProcessor(RouteContext routeContext, boolean mandatory) throws Exception
routeContext
- the route contextmandatory
- whether or not children is mandatory (ie the definition should have outputs)Exception
- is thrown if error creating the child or if it was mandatory and there was no output defined on definitionpublic void addOutput(ProcessorDefinition<?> output)
Block
public void clearOutput()
public void addRoutes(RouteContext routeContext, Collection<Route> routes) throws Exception
Exception
public Processor wrapProcessor(RouteContext routeContext, Processor processor) throws Exception
Exception
protected Processor wrapChannel(RouteContext routeContext, Processor processor, ProcessorDefinition<?> child) throws Exception
Exception
protected Processor wrapInErrorHandler(RouteContext routeContext, Processor output) throws Exception
routeContext
- the route contextoutput
- the outputException
- can be thrown if failed to create error handler builderprotected void addInterceptStrategies(RouteContext routeContext, Channel channel, List<InterceptStrategy> strategies)
routeContext
- the route contextchannel
- the channel to add strategiesstrategies
- list of strategies to add.protected Processor createCompositeProcessor(RouteContext routeContext, List<Processor> list) throws Exception
Pipeline
but derived classes could change the behaviourException
protected ModelChannel createChannel(RouteContext routeContext) throws Exception
Channel
.Exception
protected Processor createOutputsProcessor(RouteContext routeContext, Collection<ProcessorDefinition<?>> outputs) throws Exception
Exception
protected Processor createProcessor(RouteContext routeContext, ProcessorDefinition<?> output) throws Exception
Exception
protected Processor makeProcessor(RouteContext routeContext) throws Exception
Exception
protected void preCreateProcessor()
Processor
is created.public void configureChild(ProcessorDefinition<?> output)
output
- the child to be added as output to thispublic Type placeholder(String option, String key)
PropertiesComponent
option
- the name of the optionkey
- the placeholder keypublic Type attribute(QName name, Object value)
name
- the name of the attributevalue
- the valuepublic Type to(String uri)
uri
- the endpoint to send topublic Type toF(String uri, Object... args)
uri
- the String formatted endpoint uri to send toargs
- arguments for the string formatting of the uripublic Type to(Endpoint endpoint)
endpoint
- the endpoint to send topublic Type to(ExchangePattern pattern, String uri)
pattern
- the pattern to use for the message exchangeuri
- the endpoint to send topublic Type to(ExchangePattern pattern, Endpoint endpoint)
pattern
- the pattern to use for the message exchangeendpoint
- the endpoint to send topublic Type to(String... uris)
uris
- list of endpoints to send topublic Type to(Endpoint... endpoints)
endpoints
- list of endpoints to send topublic Type to(Iterable<Endpoint> endpoints)
endpoints
- list of endpoints to send topublic Type to(ExchangePattern pattern, String... uris)
pattern
- the pattern to use for the message exchangesuris
- list of endpoints to send topublic Type to(ExchangePattern pattern, Endpoint... endpoints)
pattern
- the pattern to use for the message exchangesendpoints
- list of endpoints to send topublic Type to(ExchangePattern pattern, Iterable<Endpoint> endpoints)
pattern
- the pattern to use for the message exchangesendpoints
- list of endpoints to send topublic Type setExchangePattern(ExchangePattern exchangePattern)
exchangePattern
- instance of ExchangePattern
@Deprecated public Type inOnly()
setExchangePattern(org.apache.camel.ExchangePattern)
insteadExchangePattern
to be InOnlypublic Type inOnly(String uri)
uri
- The endpoint uri which is used for sending the exchangepublic Type inOnly(Endpoint endpoint)
endpoint
- The endpoint which is used for sending the exchangepublic Type inOnly(String... uris)
uris
- list of endpoints to send topublic Type inOnly(Endpoint... endpoints)
endpoints
- list of endpoints to send topublic Type inOnly(Iterable<Endpoint> endpoints)
endpoints
- list of endpoints to send to@Deprecated public Type inOut()
setExchangePattern(org.apache.camel.ExchangePattern)
insteadExchangePattern
to be InOutpublic Type inOut(String uri)
uri
- The endpoint uri which is used for sending the exchangepublic Type inOut(Endpoint endpoint)
endpoint
- The endpoint which is used for sending the exchangepublic Type inOut(String... uris)
uris
- list of endpoints to send topublic Type inOut(Endpoint... endpoints)
endpoints
- list of endpoints to send topublic Type inOut(Iterable<Endpoint> endpoints)
endpoints
- list of endpoints to send topublic Type id(String id)
routeId(String)
instead.id
in class OptionalIdentifiedDefinition<Type extends ProcessorDefinition<Type>>
id
- the idpublic Type routeId(String id)
CamelContext
must have an unique route id.
If you use the API from CamelContext
or ModelCamelContext
to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.id
- the route id, should be uniquepublic MulticastDefinition multicast()
public MulticastDefinition multicast(AggregationStrategy aggregationStrategy, boolean parallelProcessing)
aggregationStrategy
- the strategy used to aggregate responses for
every partparallelProcessing
- if is true camel will fork thread to call the endpoint producerpublic MulticastDefinition multicast(AggregationStrategy aggregationStrategy)
aggregationStrategy
- the strategy used to aggregate responses for every partpublic PipelineDefinition pipeline()
Pipeline
so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpointpublic Type pipeline(String... uris)
Pipeline
of the list of endpoints so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpointuris
- list of endpointspublic Type pipeline(Endpoint... endpoints)
Pipeline
of the list of endpoints so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpointendpoints
- list of endpointspublic Type pipeline(Collection<Endpoint> endpoints)
Pipeline
of the list of endpoints so that the message
will get processed by each endpoint in turn and for request/response the
output of one endpoint will be the input of the next endpointendpoints
- list of endpointspublic ThreadsDefinition threads()
Exchange
using asynchronous routing engine.public ThreadsDefinition threads(int poolSize)
Exchange
using asynchronous routing engine.poolSize
- the core pool sizepublic ThreadsDefinition threads(int poolSize, int maxPoolSize)
Exchange
using asynchronous routing engine.poolSize
- the core pool sizemaxPoolSize
- the maximum pool sizepublic ThreadsDefinition threads(int poolSize, int maxPoolSize, String threadName)
Exchange
using asynchronous routing engine.poolSize
- the core pool sizemaxPoolSize
- the maximum pool sizethreadName
- the thread pool name@Deprecated public AOPDefinition aop()
public ProcessorDefinition<?> end()
public ProcessorDefinition<?> endParent()
ProcessorDefinition
s to have special logic when using end() in the DSL
to return back to the intended parent.
For example a content based router we return back to the ChoiceDefinition
when we end()
from a WhenDefinition
.public ChoiceDefinition endChoice()
choice()
DSL.public RestDefinition endRest()
rest()
DSL.public TryDefinition endDoTry()
doTry()
DSL.public IdempotentConsumerDefinition idempotentConsumer(Expression messageIdExpression)
IdempotentConsumer
to avoid duplicate messagesmessageIdExpression
- expression to test of duplicate messagespublic IdempotentConsumerDefinition idempotentConsumer(Expression messageIdExpression, IdempotentRepository<?> idempotentRepository)
IdempotentConsumer
to avoid duplicate messagesmessageIdExpression
- expression to test of duplicate messagesidempotentRepository
- the repository to use for duplicate check@Deprecated public ExpressionClause<IdempotentConsumerDefinition> idempotentConsumer(IdempotentRepository<?> idempotentRepository)
IdempotentConsumer
to avoid duplicate messagesidempotentRepository
- the repository to use for duplicate checkpublic ExpressionClause<? extends FilterDefinition> filter()
public FilterDefinition filter(Predicate predicate)
predicate
- predicate to usepublic FilterDefinition filter(ExpressionDefinition expression)
expression
- the predicate expression to usepublic FilterDefinition filter(String language, String expression)
language
- language for expressionexpression
- the expressionpublic ValidateDefinition validate(Expression expression)
PredicateValidationException
is thrown.expression
- the expressionpublic ValidateDefinition validate(Predicate predicate)
PredicateValidationException
is thrown.predicate
- the predicatepublic ExpressionClause<ValidateDefinition> validate()
PredicateValidationException
is thrown.public LoadBalanceDefinition loadBalance()
public LoadBalanceDefinition loadBalance(LoadBalancer loadBalancer)
loadBalancer
- a custom load balancer to usepublic Type log(String message)
message
- the log message, (you can use SimpleLanguage
syntax)public Type log(LoggingLevel loggingLevel, String message)
loggingLevel
- the logging level to usemessage
- the log message, (you can use SimpleLanguage
syntax)public Type log(LoggingLevel loggingLevel, String logName, String message)
loggingLevel
- the logging level to uselogName
- the log name to usemessage
- the log message, (you can use SimpleLanguage
syntax)public Type log(LoggingLevel loggingLevel, org.slf4j.Logger logger, String message)
loggingLevel
- the logging level to uselogger
- the logger to usemessage
- the log message, (you can use SimpleLanguage
syntax)public Type log(LoggingLevel loggingLevel, String logName, String marker, String message)
loggingLevel
- the logging level to uselogName
- the log name to usemarker
- log marker namemessage
- the log message, (you can use SimpleLanguage
syntax)public Type log(LoggingLevel loggingLevel, org.slf4j.Logger logger, String marker, String message)
loggingLevel
- the logging level to uselogger
- the logger to usemarker
- log marker namemessage
- the log message, (you can use SimpleLanguage
syntax)public ChoiceDefinition choice()
public TryDefinition doTry()
public RecipientListDefinition<Type> recipientList(Expression recipients)
recipients
- expression to decide the destinationspublic RecipientListDefinition<Type> recipientList(Expression recipients, String delimiter)
recipients
- expression to decide the destinationsdelimiter
- a custom delimiter to usepublic ExpressionClause<RecipientListDefinition<Type>> recipientList(String delimiter)
delimiter
- a custom delimiter to usepublic ExpressionClause<RecipientListDefinition<Type>> recipientList()
@Deprecated public Type routingSlip(String header, String uriDelimiter)
routingSlip(org.apache.camel.Expression, String)
insteaddynamicRouter()
if you need even more dynamic routing.header
- is the header that the RoutingSlip
class will look in for the list of URIs to route the message to.uriDelimiter
- is the delimiter that will be used to split up
the list of URIs in the routing slip.@Deprecated public Type routingSlip(String header)
routingSlip(org.apache.camel.Expression)
insteadRoutingSlipDefinition.DEFAULT_DELIMITER
The route slip will be evaluated once, use dynamicRouter()
if you need even more dynamic routing.header
- is the header that the RoutingSlip
class will look in for the list of URIs to route the message to.@Deprecated public Type routingSlip(String header, String uriDelimiter, boolean ignoreInvalidEndpoints)
routingSlip()
insteaddynamicRouter()
if you need even more dynamic routing.header
- is the header that the RoutingSlip
class will look in for the list of URIs to route the message to.uriDelimiter
- is the delimiter that will be used to split up
the list of URIs in the routing slip.ignoreInvalidEndpoints
- if this parameter is true, routingSlip will ignore the endpoints which
cannot be resolved or a producer cannot be created or started@Deprecated public Type routingSlip(String header, boolean ignoreInvalidEndpoints)
routingSlip()
insteadRoutingSlipDefinition.DEFAULT_DELIMITER
The route slip will be evaluated once, use dynamicRouter()
if you need even more dynamic routing.header
- is the header that the RoutingSlip
class will look in for the list of URIs to route the message to.ignoreInvalidEndpoints
- if this parameter is true, routingSlip will ignore the endpoints which
cannot be resolved or a producer cannot be created or startedpublic RoutingSlipDefinition<Type> routingSlip(Expression expression, String uriDelimiter)
dynamicRouter()
if you need even more dynamic routing.expression
- to decide the destinationsuriDelimiter
- is the delimiter that will be used to split up
the list of URIs in the routing slip.public RoutingSlipDefinition<Type> routingSlip(Expression expression)
RoutingSlipDefinition.DEFAULT_DELIMITER
The route slip will be evaluated once, use dynamicRouter()
if you need even more dynamic routing.expression
- to decide the destinationspublic ExpressionClause<RoutingSlipDefinition<Type>> routingSlip()
RoutingSlipDefinition.DEFAULT_DELIMITER
The route slip will be evaluated once, use dynamicRouter()
if you need even more dynamic routing.public DynamicRouterDefinition<Type> dynamicRouter(Expression expression)
expression
- to decide the destinations, which will be invoked repeatedly
until it evaluates null to indicate no more destinations.public ExpressionClause<DynamicRouterDefinition<Type>> dynamicRouter()
public SamplingDefinition sample()
public SamplingDefinition sample(long samplePeriod, TimeUnit unit)
samplePeriod
- this is the sample interval, only one exchange is
allowed through in this intervalunit
- this is the units for the samplePeriod e.g. Secondspublic SamplingDefinition sample(long messageFrequency)
messageFrequency
- this is the sample message frequency, only one exchange is
allowed through for this many messages receivedpublic ExpressionClause<SplitDefinition> split()
This splitter responds with the original input message. You can use a custom AggregationStrategy
to
control what to respond from the splitter.
public SplitDefinition split(Expression expression)
This splitter responds with the original input message. You can use a custom AggregationStrategy
to
control what to respond from the splitter.
expression
- the expression on which to split the messagepublic SplitDefinition split(Expression expression, AggregationStrategy aggregationStrategy)
The splitter responds with the answer produced by the given AggregationStrategy
.
expression
- the expression on which to splitaggregationStrategy
- the strategy used to aggregate responses for every partpublic ExpressionClause<ResequenceDefinition> resequence()
public ResequenceDefinition resequence(Expression expression)
expression
- the expression on which to compare messages in orderpublic ExpressionClause<AggregateDefinition> aggregate()
public ExpressionClause<AggregateDefinition> aggregate(AggregationStrategy aggregationStrategy)
aggregationStrategy
- the strategy used for the aggregationpublic AggregateDefinition aggregate(Expression correlationExpression)
correlationExpression
- the expression used to calculate the
correlation key. For a JMS message this could be the
expression header("JMSDestination")
or
header("JMSCorrelationID")
public AggregateDefinition aggregate(Expression correlationExpression, AggregationStrategy aggregationStrategy)
correlationExpression
- the expression used to calculate the
correlation key. For a JMS message this could be the
expression header("JMSDestination")
or
header("JMSCorrelationID")
aggregationStrategy
- the strategy used for the aggregationpublic DelayDefinition delay(Expression delay)
delay
- an expression to calculate the delay time in millispublic ExpressionClause<DelayDefinition> delay()
public DelayDefinition delay(long delay)
delay
- the delay in millispublic ThrottleDefinition throttle(long maximumRequestCount)
maximumRequestCount
- the maximum messagespublic ThrottleDefinition throttle(Expression maximumRequestCount)
maximumRequestCount
- an expression to calculate the maximum request countpublic ExpressionClause<LoopDefinition> loop()
public LoopDefinition loop(Expression expression)
expression
- the loop expressionpublic LoopDefinition loop(int count)
count
- the number of timespublic Type throwException(Exception exception)
Exchange
exception
- the exception to throwpublic Type markRollbackOnly()
rollback()
methods.rollback()
,
rollback(String)
,
markRollbackOnlyLast()
public Type markRollbackOnlyLast()
rollback()
methods.rollback()
,
rollback(String)
,
markRollbackOnly()
public Type rollback()
RollbackExchangeException
on the Exchange
and mark it for rollback.markRollbackOnly()
public Type rollback(String message)
RollbackExchangeException
on the Exchange
and mark it for rollback.message
- an optional message used for logging purpose why the rollback was triggeredmarkRollbackOnly()
public WireTapDefinition<Type> wireTap(String uri)
ExchangePattern.InOnly
.uri
- the destination@Deprecated public WireTapDefinition<Type> wireTap(String uri, ExecutorService executorService)
WireTapDefinition
, will be removed in Camel 3.0ExchangePattern.InOnly
.uri
- the destinationexecutorService
- a custom ExecutorService
to use as thread pool
for sending tapped exchanges@Deprecated public WireTapDefinition<Type> wireTap(String uri, String executorServiceRef)
WireTapDefinition
, will be removed in Camel 3.0ExchangePattern.InOnly
.uri
- the destinationexecutorServiceRef
- reference to lookup a custom ExecutorService
to use as thread pool for sending tapped exchanges@Deprecated public WireTapDefinition<Type> wireTap(String uri, Expression body)
WireTapDefinition
, will be removed in Camel 3.0Exchange
to the destination
using ExchangePattern.InOnly
.
Will use a copy of the original Exchange which is passed in as argument
to the given expressionuri
- the destinationbody
- expression that creates the body to send@Deprecated public WireTapDefinition<Type> wireTap(String uri, boolean copy, Expression body)
WireTapDefinition
, will be removed in Camel 3.0uri
- the destinationcopy
- whether or not use a copy of the original exchange or a new empty exchangebody
- expression that creates the body to send@Deprecated public WireTapDefinition<Type> wireTap(String uri, Processor processor)
WireTapDefinition
, will be removed in Camel 3.0Exchange
to the destination
using ExchangePattern.InOnly
.
Will use a copy of the original Exchange which is passed in as argument
to the given processoruri
- the destinationprocessor
- processor preparing the new exchange to send@Deprecated public WireTapDefinition<Type> wireTap(String uri, boolean copy, Processor processor)
WireTapDefinition
, will be removed in Camel 3.0uri
- the destinationcopy
- whether or not use a copy of the original exchange or a new empty exchangeprocessor
- processor preparing the new exchange to sendpublic Type startupOrder(int startupOrder)
public Type stop()
Exchange
and marks it as completed.public OnExceptionDefinition onException(Class<? extends Throwable> exceptionType)
exceptionType
- the exception to catchpublic OnExceptionDefinition onException(Class<? extends Throwable>... exceptions)
exceptions
- list of exceptions to catchpublic PolicyDefinition policy(Policy policy)
Policy
.
Policy can be used for transactional policies.policy
- the policy to applypublic PolicyDefinition policy(String ref)
Policy
.
Policy can be used for transactional policies.ref
- reference to lookup a policy in the registrypublic TransactedDefinition transacted()
public TransactedDefinition transacted(String ref)
ref
- reference to lookup a transacted policy in the registrypublic Type process(Processor processor)
processor
- the custom Processor
public Type processRef(String ref)
ref
- reference to a Processor
to lookup in the registrypublic Type bean(Object bean)
bean
- the bean to invokepublic Type bean(Object bean, String method)
bean
- the bean to invokemethod
- the method name to invoke on the bean (can be used to avoid ambiguity)public Type bean(Object bean, String method, boolean multiParameterArray)
bean
- the bean to invokemethod
- the method name to invoke on the bean (can be used to avoid ambiguity)multiParameterArray
- if it is true, camel will treat the message body as an object array which holds
the multi parameterpublic Type bean(Class<?> beanType)
beanType
- the bean class, Camel will instantiate an object at runtimepublic Type bean(Class<?> beanType, String method)
beanType
- the bean class, Camel will instantiate an object at runtimemethod
- the method name to invoke on the bean (can be used to avoid ambiguity)public Type bean(Class<?> beanType, String method, boolean multiParameterArray)
beanType
- the bean class, Camel will instantiate an object at runtimemethod
- the method name to invoke on the bean (can be used to avoid ambiguity)multiParameterArray
- if it is true, camel will treat the message body as an object array which holds
the multi parameterpublic Type bean(Class<?> beanType, String method, boolean multiParameterArray, boolean cache)
beanType
- the bean class, Camel will instantiate an object at runtimemethod
- the method name to invoke on the bean (can be used to avoid ambiguity)multiParameterArray
- if it is true, camel will treat the message body as an object array which holds
the multi parametercache
- if enabled, Camel will cache the result of the first Registry look-up.
Cache can be enabled if the bean in the Registry is defined as a singleton scope.public Type beanRef(String ref)
ref
- reference to a bean to lookup in the registrypublic Type beanRef(String ref, String method)
ref
- reference to a bean to lookup in the registrymethod
- the method name to invoke on the bean (can be used to avoid ambiguity)public Type beanRef(String ref, boolean cache)
ref
- reference to a bean to lookup in the registrycache
- if enabled, Camel will cache the result of the first Registry look-up.
Cache can be enabled if the bean in the Registry is defined as a singleton scope.public Type beanRef(String ref, String method, boolean cache)
ref
- reference to a bean to lookup in the registrymethod
- the method name to invoke on the bean (can be used to avoid ambiguity)cache
- if enabled, Camel will cache the result of the first Registry look-up.
Cache can be enabled if the bean in the Registry is defined as a singleton scope.public Type beanRef(String ref, String method, boolean cache, boolean multiParameterArray)
ref
- reference to a bean to lookup in the registrymethod
- the method name to invoke on the bean (can be used to avoid ambiguity)cache
- if enabled, Camel will cache the result of the first Registry look-up.
Cache can be enabled if the bean in the Registry is defined as a singleton scope.multiParameterArray
- if it is true, camel will treat the message body as an object array which holds
the multi parameterpublic ExpressionClause<ProcessorDefinition<Type>> setBody()
public Type setBody(Expression expression)
expression
- the expression used to set the bodypublic Type transform(Expression expression)
expression
- the expression used to set the bodypublic ExpressionClause<ProcessorDefinition<Type>> transform()
public Type setFaultBody(Expression expression)
expression
- the expression used to set the bodypublic ExpressionClause<ProcessorDefinition<Type>> setHeader(String name)
name
- the header namepublic Type setHeader(String name, Expression expression)
name
- the header nameexpression
- the expression used to set the header@Deprecated public ExpressionClause<ProcessorDefinition<Type>> setOutHeader(String name)
setHeader(String)
name
- the header name@Deprecated public Type setOutHeader(String name, Expression expression)
setHeader(String, org.apache.camel.Expression)
name
- the header nameexpression
- the expression used to set the header@Deprecated public Type setFaultHeader(String name, Expression expression)
setHeader(String, org.apache.camel.Expression)
name
- the header nameexpression
- the expression used to set the headerpublic Type setProperty(String name, Expression expression)
name
- the property nameexpression
- the expression used to set the propertypublic ExpressionClause<ProcessorDefinition<Type>> setProperty(String name)
name
- the property namepublic Type removeHeader(String name)
name
- the header namepublic Type removeHeaders(String pattern)
pattern
- a pattern to match header names to be removedpublic Type removeHeaders(String pattern, String... excludePatterns)
pattern
- a pattern to match header names to be removedexcludePatterns
- one or more pattern of header names that should be excluded (= preserved)@Deprecated public Type removeFaultHeader(String name)
removeHeader(String)
name
- the header namepublic Type removeProperty(String name)
name
- the property namepublic Type convertBodyTo(Class<?> type)
type
- the type to convert topublic Type convertBodyTo(Class<?> type, String charset)
type
- the type to convert tocharset
- the charset to use by type converters (not all converters support specifc charset)public Type sort(Expression expression)
expression
- the expression, must be convertable to List
public <T> Type sort(Expression expression, Comparator<T> comparator)
expression
- the expression, must be convertable to List
comparator
- the comparator to use for sortingpublic <T> ExpressionClause<SortDefinition<T>> sort()
public Type enrich(String resourceUri, AggregationStrategy aggregationStrategy)
resourceUri
.resourceUri
- URI of resource endpoint for obtaining additional data.aggregationStrategy
- aggregation strategy to aggregate input data and additional data.Enricher
public Type enrich(String resourceUri, AggregationStrategy aggregationStrategy, boolean aggregateOnException)
resourceUri
.resourceUri
- URI of resource endpoint for obtaining additional data.aggregationStrategy
- aggregation strategy to aggregate input data and additional data.Enricher
public Type enrich(String resourceUri)
resourceUri
.
The difference between this and pollEnrich(String)
is that this uses a producer
to obatin the additional data, where as pollEnrich uses a polling consumer.resourceUri
- URI of resource endpoint for obtaining additional data.Enricher
public Type enrichRef(String resourceRef, String aggregationStrategyRef)
resourceUri
.
The difference between this and pollEnrich(String)
is that this uses a producer
to obtain the additional data, where as pollEnrich uses a polling consumer.resourceRef
- Reference of resource endpoint for obtaining additional data.aggregationStrategyRef
- Reference of aggregation strategy to aggregate input data and additional data.Enricher
public Type enrichRef(String resourceRef, String aggregationStrategyRef, boolean aggregateOnException)
resourceUri
.
The difference between this and pollEnrich(String)
is that this uses a producer
to obtain the additional data, where as pollEnrich uses a polling consumer.resourceRef
- Reference of resource endpoint for obtaining additional data.aggregationStrategyRef
- Reference of aggregation strategy to aggregate input data and additional data.aggregateOnException
- whether to call AggregationStrategy.aggregate(org.apache.camel.Exchange, org.apache.camel.Exchange)
if
an exception was thrown.Enricher
public Type pollEnrich(String resourceUri)
resourceUri
using a PollingConsumer
to poll the endpoint.
The difference between this and enrich(String)
is that this uses a consumer
to obtain the additional data, where as enrich uses a producer.
This method will block until data is available, use the method with timeout if you do not
want to risk waiting a long time before data is available from the resourceUri.resourceUri
- URI of resource endpoint for obtaining additional data.PollEnricher
public Type pollEnrich(String resourceUri, AggregationStrategy aggregationStrategy)
resourceUri
using a PollingConsumer
to poll the endpoint.
The difference between this and enrich(String)
is that this uses a consumer
to obtain the additional data, where as enrich uses a producer.
This method will block until data is available, use the method with timeout if you do not
want to risk waiting a long time before data is available from the resourceUri.resourceUri
- URI of resource endpoint for obtaining additional data.aggregationStrategy
- aggregation strategy to aggregate input data and additional data.PollEnricher
public Type pollEnrich(String resourceUri, long timeout, AggregationStrategy aggregationStrategy)
resourceUri
using a PollingConsumer
to poll the endpoint.
The difference between this and enrich(String)
is that this uses a consumer
to obtain the additional data, where as enrich uses a producer.
The timeout controls which operation to use on PollingConsumer
.
If timeout is negative, we use receive. If timeout is 0 then we use receiveNoWait
otherwise we use receive(timeout).resourceUri
- URI of resource endpoint for obtaining additional data.timeout
- timeout in millis to wait at most for data to be available.aggregationStrategy
- aggregation strategy to aggregate input data and additional data.PollEnricher
public Type pollEnrich(String resourceUri, long timeout, AggregationStrategy aggregationStrategy, boolean aggregateOnException)
resourceUri
using a PollingConsumer
to poll the endpoint.
The difference between this and enrich(String)
is that this uses a consumer
to obtain the additional data, where as enrich uses a producer.
The timeout controls which operation to use on PollingConsumer
.
If timeout is negative, we use receive. If timeout is 0 then we use receiveNoWait
otherwise we use receive(timeout).resourceUri
- URI of resource endpoint for obtaining additional data.timeout
- timeout in millis to wait at most for data to be available.aggregationStrategy
- aggregation strategy to aggregate input data and additional data.aggregateOnException
- whether to call AggregationStrategy.aggregate(org.apache.camel.Exchange, org.apache.camel.Exchange)
if
an exception was thrown.PollEnricher
public Type pollEnrich(String resourceUri, long timeout)
resourceUri
using a PollingConsumer
to poll the endpoint.
The difference between this and enrich(String)
is that this uses a consumer
to obtain the additional data, where as enrich uses a producer.
The timeout controls which operation to use on PollingConsumer
.
If timeout is negative, we use receive. If timeout is 0 then we use receiveNoWait
otherwise we use receive(timeout).resourceUri
- URI of resource endpoint for obtaining additional data.timeout
- timeout in millis to wait at most for data to be available.PollEnricher
public Type pollEnrichRef(String resourceRef, long timeout, String aggregationStrategyRef)
resourceUri
using a PollingConsumer
to poll the endpoint.
The difference between this and enrich(String)
is that this uses a consumer
to obtain the additional data, where as enrich uses a producer.
The timeout controls which operation to use on PollingConsumer
.
If timeout is negative, we use receive. If timeout is 0 then we use receiveNoWait
otherwise we use receive(timeout).resourceRef
- Reference of resource endpoint for obtaining additional data.timeout
- timeout in millis to wait at most for data to be available.aggregationStrategyRef
- Reference of aggregation strategy to aggregate input data and additional data.PollEnricher
public Type pollEnrichRef(String resourceRef, long timeout, String aggregationStrategyRef, boolean aggregateOnException)
resourceUri
using a PollingConsumer
to poll the endpoint.
The difference between this and enrich(String)
is that this uses a consumer
to obtain the additional data, where as enrich uses a producer.
The timeout controls which operation to use on PollingConsumer
.
If timeout is negative, we use receive. If timeout is 0 then we use receiveNoWait
otherwise we use receive(timeout).resourceRef
- Reference of resource endpoint for obtaining additional data.timeout
- timeout in millis to wait at most for data to be available.aggregationStrategyRef
- Reference of aggregation strategy to aggregate input data and additional data.aggregateOnException
- whether to call AggregationStrategy.aggregate(org.apache.camel.Exchange, org.apache.camel.Exchange)
if
an exception was thrown.PollEnricher
public OnCompletionDefinition onCompletion()
Synchronization
hook that invoke this route as
a callback when the Exchange
has finished being processed.
The hook invoke callbacks for either onComplete or onFailure.
Will by default always trigger when the Exchange
is complete
(either with success or failed).
Exchange
with the key Exchange.EXCEPTION_CAUGHT
.public DataFormatClause<ProcessorDefinition<Type>> unmarshal()
DataFormat
expression to define
the format of the input message and the output will be set on the out message body.DataFormat
public Type unmarshal(DataFormatDefinition dataFormatType)
DataFormat
and sets the output on the out message body.dataFormatType
- the dataformatpublic Type unmarshal(DataFormat dataFormat)
DataFormat
and sets the output on the out message body.dataFormat
- the dataformatpublic Type unmarshal(String dataTypeRef)
DataFormat
reference in the Registry
and sets
the output on the out message body.dataTypeRef
- reference to a DataFormat
to lookup in the registrypublic DataFormatClause<ProcessorDefinition<Type>> marshal()
DataFormat
expression to define
the format of the output which will be added to the out body.DataFormat
public Type marshal(DataFormatDefinition dataFormatType)
DataFormat
and sets the output on the out message body.dataFormatType
- the dataformatpublic Type marshal(DataFormat dataFormat)
DataFormat
and sets the output on the out message body.dataFormat
- the dataformatpublic Type marshal(String dataTypeRef)
DataFormat
reference in the Registry
and sets
the output on the out message body.dataTypeRef
- reference to a DataFormat
to lookup in the registrypublic Type inheritErrorHandler(boolean inheritErrorHandler)
inheritErrorHandler
- whether to not to inherit the error handler for this nodepublic ProcessorDefinition<?> getParent()
public void setParent(ProcessorDefinition<?> parent)
public List<InterceptStrategy> getInterceptStrategies()
public void addInterceptStrategy(InterceptStrategy strategy)
public Boolean isInheritErrorHandler()
public void setInheritErrorHandler(Boolean inheritErrorHandler)
public Map<QName,Object> getOtherAttributes()
public void setOtherAttributes(Map<QName,Object> otherAttributes)
Apache Camel