Package io.vertx.camel
Class InboundMapping
- java.lang.Object
-
- io.vertx.camel.CamelMapping
-
- io.vertx.camel.InboundMapping
-
public class InboundMapping extends CamelMapping
Represents a mapping between a Camel endpoint address and a Vert.x address on the event bus.- Author:
- Clement Escoffier
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_PUBLISH
The default value of the "publish" property.-
Fields inherited from class io.vertx.camel.CamelMapping
DEFAULT_HEADERS_COPY
-
-
Constructor Summary
Constructors Constructor Description InboundMapping()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InboundMapping
fromCamelβ(String uri)
Creates anInboundMapping
from the given Camel endpoint.static InboundMapping
fromCamelβ(org.apache.camel.Endpoint endpoint)
Creates anInboundMapping
from the given Camel endpoint.Class
getBodyType()
int
getTimeout()
boolean
isPublish()
InboundMapping
setAddressβ(String address)
Sets the event bus address.InboundMapping
setEndpointβ(org.apache.camel.Endpoint endpoint)
Sets the Camel endpoint.InboundMapping
setHeadersCopyβ(boolean headersCopy)
Sets whether or not the headers of the input message are copied in the output message.InboundMapping
setTimeoutβ(int timeout)
Sets the timeout in milliseconds.InboundMapping
setUriβ(String uri)
Sets the Camel endpoint URI.InboundMapping
toVertxβ(String address)
Fluent version ofsetAddress(String)
.InboundMapping
usePublish()
Sets whether or notpublish
is used instead ofsend
, when a message is sent on the event bus.InboundMapping
withBodyTypeβ(Class bodyType)
Sets the type of the body of the event bus message.InboundMapping
withoutHeadersCopy()
Fluent version ofsetHeadersCopy(boolean)
to disable the headers copy (so the parameter isfalse
).-
Methods inherited from class io.vertx.camel.CamelMapping
getAddress, getUri, isHeadersCopy
-
-
-
-
Field Detail
-
DEFAULT_PUBLISH
public static final boolean DEFAULT_PUBLISH
The default value of the "publish" property. By default, the bridge usessend
.- See Also:
- Constant Field Values
-
-
Method Detail
-
fromCamel
public static InboundMapping fromCamelβ(String uri)
Creates anInboundMapping
from the given Camel endpoint.- Parameters:
uri
- the uri - must not benull
- Returns:
- the created
InboundMapping
-
fromCamel
public static InboundMapping fromCamelβ(org.apache.camel.Endpoint endpoint)
Creates anInboundMapping
from the given Camel endpoint.- Parameters:
endpoint
- the endpoint - must not benull
- Returns:
- the created
InboundMapping
-
isPublish
public boolean isPublish()
- Returns:
- whether or not
publish
is used instead ofsend
, when a message is sent on the event bus.send
is used by default.
-
getBodyType
public Class 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
public InboundMapping withBodyTypeβ(Class bodyType)
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
public InboundMapping setAddressβ(String address)
Description copied from class:CamelMapping
Sets the event bus address.- Overrides:
setAddress
in classCamelMapping
- Parameters:
address
- the address- Returns:
- the current
CamelMapping
-
toVertx
public InboundMapping toVertxβ(String address)
Fluent version ofsetAddress(String)
.- Parameters:
address
- the Vert.x event bus address- Returns:
- the current
InboundMapping
instance - See Also:
setAddress(String)
-
withoutHeadersCopy
public InboundMapping withoutHeadersCopy()
Fluent version ofsetHeadersCopy(boolean)
to disable the headers copy (so the parameter isfalse
).- Returns:
- the current
InboundMapping
instance - See Also:
setHeadersCopy(boolean)
-
setHeadersCopy
public InboundMapping setHeadersCopyβ(boolean headersCopy)
Description copied from class:CamelMapping
Sets whether or not the headers of the input message are copied in the output message.- Overrides:
setHeadersCopy
in classCamelMapping
- Parameters:
headersCopy
-true
to copy the headers- Returns:
- the current
CamelMapping
-
setUri
public InboundMapping setUriβ(String uri)
Description copied from class:CamelMapping
Sets the Camel endpoint URI.- Overrides:
setUri
in classCamelMapping
- Parameters:
uri
- the uri- Returns:
- the current
CamelMapping
-
setEndpoint
public InboundMapping setEndpointβ(org.apache.camel.Endpoint endpoint)
Description copied from class:CamelMapping
Sets the Camel endpoint. If used,CamelMapping.setUri(String)
does not need to be called.- Overrides:
setEndpoint
in classCamelMapping
- Parameters:
endpoint
- the endpoint- Returns:
- the current
CamelMapping
-
usePublish
public InboundMapping usePublish()
Sets whether or notpublish
is used instead ofsend
, when a message is sent on the event bus.send
is used by default, so calling this method instructs the bridge to usepublish
.- Returns:
- the current
InboundMapping
-
setTimeout
public InboundMapping setTimeoutβ(int timeout)
Sets the timeout in milliseconds.- Parameters:
timeout
- the time out, must be strictly positive- Returns:
- the current
InboundMapping
-
getTimeout
public int getTimeout()
-
-