CometD

CometD

Scheme: cometd
Syntax: cometd:host:port/channelName
Alternative Schemes: cometd,cometds
Description: The cometd component is a transport for working with the Jetty implementation of the cometd/bayeux protocol.
Deprecated:false
Async:false
Maven: org.apache.camel/camel-cometd/2.18.1.redhat-000032

The cometd component is a transport for working with the Jetty implementation of the cometd/bayeux protocol. Using this component in combination with the dojo toolkit library it's possible to push Camel messages directly into the browser using an AJAX based mechanism.

Name Kind Group Required Default Type Enum Description
host path common true java.lang.String Hostname
port path common true int Host port number
channelName path common true java.lang.String The channelName represents a topic that can be subscribed to by the Camel endpoints.
allowedOrigins parameter common * java.lang.String The origins domain that support to cross, if the crosssOriginFilterOn is true
baseResource parameter common java.lang.String The root directory for the web resources or classpath. Use the protocol file: or classpath: depending if you want that the component loads the resource from file system or classpath. Classpath is required for OSGI deployment where the resources are packaged in the jar
crossOriginFilterOn parameter common boolean If true, the server will support for cross-domain filtering
filterPath parameter common java.lang.String The filterPath will be used by the CrossOriginFilter, if the crosssOriginFilterOn is true
interval parameter common int The client side poll timeout in milliseconds. How long a client will wait between reconnects
jsonCommented parameter common true boolean If true, the server will accept JSON wrapped in a comment and will generate JSON wrapped in a comment. This is a defence against Ajax Hijacking.
logLevel parameter common 1 int 0
1
2
Logging level. 0=none, 1=info, 2=debug.
maxInterval parameter common 30000 int The max client side poll timeout in milliseconds. A client will be removed if a connection is not received in this time.
multiFrameInterval parameter common 1500 int The client side poll timeout, if multiple connections are detected from the same browser.
timeout parameter common 240000 int The server side poll timeout in milliseconds. This is how long the server will hold a reconnect request before responding.
bridgeErrorHandler parameter consumer boolean Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored.
sessionHeadersEnabled parameter consumer boolean Whether to include the server session headers in the Camel message when creating a Camel Message for incoming requests.
exceptionHandler parameter consumer (advanced) org.apache.camel.spi.ExceptionHandler To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored.
exchangePattern parameter consumer (advanced) org.apache.camel.ExchangePattern InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the exchange pattern when the consumer creates an exchange.
disconnectLocalSession parameter producer boolean Whether to disconnect local sessions after publishing a message to its channel. Disconnecting local session is needed as they are not swept by default by CometD, and therefore you can run out of memory.
synchronous parameter advanced false boolean Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

cometd consumer

A Consumer for receiving messages using Cometd and Bayeux protocol.