2 Home
gitea_admin edited this page 2026-03-11 14:36:46 +00:00

CometD (Secure)

Offers publish/subscribe, peer-to-peer (via a server), and RPC style messaging using the CometD/Bayeux protocol.

Metadata

Property Value
Scheme cometds
Support Level Stable
Labels networking,messaging
Version 4.10.2

Maven Dependency

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-cometd</artifactId>
    <version>4.10.2</version>
</dependency>

Endpoint Properties

Name Type Required Default Description
host string Hostname
port integer Host port number
channelName string The channelName represents a topic that can be subscribed to by the Camel endpoints.
allowedOrigins string * The origins domain that support to cross, if the crosssOriginFilterOn is true
baseResource 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 boolean false If true, the server will support for cross-domain filtering
filterPath string The filterPath will be used by the CrossOriginFilter, if the crosssOriginFilterOn is true
interval integer The client side poll timeout in milliseconds. How long a client will wait between reconnects
jsonCommented boolean true 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 integer 1 Logging level. 0=none, 1=info, 2=debug.
maxInterval integer 30000 The max client side poll timeout in milliseconds. A client will be removed if a connection is not received in this time.
multiFrameInterval integer 1500 The client side poll timeout, if multiple connections are detected from the same browser.
timeout integer 240000 The server side poll timeout in milliseconds. This is how long the server will hold a reconnect request before responding.
sessionHeadersEnabled boolean false Whether to include the server session headers in the Camel message when creating a Camel Message for incoming requests.
bridgeErrorHandler boolean false Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exceptionHandler object To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exchangePattern object Sets the exchange pattern when the consumer creates an exchange.
disconnectLocalSession boolean false 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.
lazyStartProducer boolean false Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.