Package org.apache.camel.builder
Class ExchangeBuilder
java.lang.Object
org.apache.camel.builder.ExchangeBuilder
Builder to create
Exchange
and add headers and set body on the Exchange Message
.
Use the build()
method when done setting up the exchange.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExchangeBuilder
anExchange
(org.apache.camel.CamelContext context) Create the exchange by setting the camel contextorg.apache.camel.Exchange
build()
Build up the exchange from the exchange builderSet the in message body on the exchangewithHeader
(String key, Object value) Set the message header of the in message on the exchangewithPattern
(org.apache.camel.ExchangePattern pattern) Set the message exchange pattern on the exchangewithProperty
(String key, Object value) Set the exchange property
-
Constructor Details
-
ExchangeBuilder
public ExchangeBuilder(org.apache.camel.CamelContext context)
-
-
Method Details
-
anExchange
Create the exchange by setting the camel context- Parameters:
context
- the camel context- Returns:
- exchange builder
-
withBody
Set the in message body on the exchange- Parameters:
body
- the body- Returns:
- exchange builder
-
withHeader
Set the message header of the in message on the exchange- Parameters:
key
- the key of the headervalue
- the value of the header- Returns:
- exchange builder
-
withPattern
Set the message exchange pattern on the exchange- Parameters:
pattern
- exchange pattern- Returns:
- exchange builder
-
withProperty
Set the exchange property- Parameters:
key
- the key of the exchange propertyvalue
- the value of the exchange property- Returns:
- exchange builder
-
build
public org.apache.camel.Exchange build()Build up the exchange from the exchange builder- Returns:
- exchange
-