Cometd Component
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.
URI format
cometd://host:port/channelName[?options]
The channelName represents a topic that can be subscribed to by the Camel endpoints.
Examples
cometd://localhost:8080/service/mychannel cometds://localhost:8443/service/mychannel
where cometds:
represents an SSL configured endpoint.
See this blog entry by David Greco who contributed this component to Apache Camel, for a full sample.
Options
Name |
Default Value |
Description |
---|---|---|
|
|
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 |
|
|
The server side poll timeout in milliseconds. This is how long the server will hold a reconnect request before responding. |
|
|
The client side poll timeout in milliseconds. How long a client will wait between reconnects |
|
|
The max client side poll timeout in milliseconds. A client will be removed if a connection is not received in this time. |
|
|
The client side poll timeout, if multiple connections are detected from the same browser. |
|
|
If |
|
|
|
You can append query options to the URI in the following format, ?option=value&option=value&...
Here is some examples on How to pass the parameters
For file (for webapp resources located in the Web Application directory --> cometd://localhost:8080?resourceBase=file./webapp
For classpath (when by example the web resources are packaged inside the webapp folder --> cometd://localhost:8080?resourceBase=classpath:webapp