Class InboundMapping
java.lang.Object
io.vertx.camel.CamelMapping
io.vertx.camel.InboundMapping
Represents a mapping between a Camel endpoint address and a Vert.x address on the event bus.
- Author:
- Clement Escoffier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default value of the "publish" property.Fields inherited from class CamelMapping
DEFAULT_HEADERS_COPY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InboundMappingCreates anInboundMappingfrom the given Camel endpoint.static InboundMappingfromCamel(org.apache.camel.Endpoint endpoint) Creates anInboundMappingfrom the given Camel endpoint.intbooleansetAddress(String address) Sets the event bus address.setEndpoint(org.apache.camel.Endpoint endpoint) Sets the Camel endpoint.setHeadersCopy(boolean headersCopy) Sets whether or not the headers of the input message are copied in the output message.setTimeout(int timeout) Sets the timeout in milliseconds.Sets the Camel endpoint URI.Fluent version ofsetAddress(String).Sets whether or notpublishis used instead ofsend, when a message is sent on the event bus.withBodyType(Class bodyType) Sets the type of the body of the event bus message.Fluent version ofsetHeadersCopy(boolean)to disable the headers copy (so the parameter isfalse).Methods inherited from class CamelMapping
getAddress, getUri, isHeadersCopy
-
Field Details
-
DEFAULT_PUBLISH
public static final boolean DEFAULT_PUBLISHThe default value of the "publish" property. By default, the bridge usessend.- See Also:
-
-
Constructor Details
-
InboundMapping
public InboundMapping()
-
-
Method Details
-
fromCamel
Creates anInboundMappingfrom the given Camel endpoint.- Parameters:
uri- the uri - must not benull- Returns:
- the created
InboundMapping
-
fromCamel
Creates anInboundMappingfrom the given Camel endpoint.- Parameters:
endpoint- the endpoint - must not benull- Returns:
- the created
InboundMapping
-
isPublish
public boolean isPublish()- Returns:
- whether or not
publishis used instead ofsend, when a message is sent on the event bus.sendis used by default.
-
getBodyType
- Returns:
- the type of the body of the message that are sent on the event bus. A Camel converter from the Camel message payload to the given type is used for conversion. If not set, no conversions are applied.
-
withBodyType
Sets the type of the body of the event bus message. A Camel converter from the Camel message payload to the given type is used for conversion. If not set, no conversions are applied.- Parameters:
bodyType- the body type.- Returns:
- the current
InboundMapping
-
setAddress
Description copied from class:CamelMappingSets the event bus address.- Overrides:
setAddressin classCamelMapping- Parameters:
address- the address- Returns:
- the current
CamelMapping
-
toVertx
Fluent version ofsetAddress(String).- Parameters:
address- the Vert.x event bus address- Returns:
- the current
InboundMappinginstance - See Also:
-
withoutHeadersCopy
Fluent version ofsetHeadersCopy(boolean)to disable the headers copy (so the parameter isfalse).- Returns:
- the current
InboundMappinginstance - See Also:
-
setHeadersCopy
Description copied from class:CamelMappingSets whether or not the headers of the input message are copied in the output message.- Overrides:
setHeadersCopyin classCamelMapping- Parameters:
headersCopy-trueto copy the headers- Returns:
- the current
CamelMapping
-
setUri
Description copied from class:CamelMappingSets the Camel endpoint URI.- Overrides:
setUriin classCamelMapping- Parameters:
uri- the uri- Returns:
- the current
CamelMapping
-
setEndpoint
Description copied from class:CamelMappingSets the Camel endpoint. If used,CamelMapping.setUri(String)does not need to be called.- Overrides:
setEndpointin classCamelMapping- Parameters:
endpoint- the endpoint- Returns:
- the current
CamelMapping
-
usePublish
Sets whether or notpublishis used instead ofsend, when a message is sent on the event bus.sendis used by default, so calling this method instructs the bridge to usepublish.- Returns:
- the current
InboundMapping
-
setTimeout
Sets the timeout in milliseconds.- Parameters:
timeout- the time out, must be strictly positive- Returns:
- the current
InboundMapping
-
getTimeout
public int getTimeout()
-