Added camel-atmosphere-websocket docs to gitbook
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1783e696 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1783e696 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1783e696 Branch: refs/heads/master Commit: 1783e696c99f2fb5f945308f9cbd42813e6cd87d Parents: aadade7 Author: Andrea Cosentino <[email protected]> Authored: Tue Jan 26 10:05:12 2016 +0100 Committer: Andrea Cosentino <[email protected]> Committed: Tue Jan 26 11:38:17 2016 +0100 ---------------------------------------------------------------------- .../src/main/docs/atmosphere-websocket.adoc | 112 +++++++++++++++++++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 113 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/1783e696/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket.adoc ---------------------------------------------------------------------- diff --git a/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket.adoc b/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket.adoc new file mode 100644 index 0000000..f0e7c33 --- /dev/null +++ b/components/camel-atmosphere-websocket/src/main/docs/atmosphere-websocket.adoc @@ -0,0 +1,112 @@ +[[Atmosphere-Websocket-AtmosphereWebsocketServletComponent]] +Atmosphere Websocket Servlet Component +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +*Available as of Camel 2.14* + +The *atmosphere-websocket:* component provides Websocket +based link:endpoint.html[endpoints] for a servlet communicating with +external clients over Websocket (as a servlet accepting websocket +connections from external clients). + +The component uses the link:servlet.html[SERVLET] component and uses +the https://github.com/Atmosphere/atmosphere[Atmosphere] library to +support the Websocket transport in various Servlet containers (e..g., +Jetty, Tomcat, ...). + +Unlike the +https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=39621544[Websocket] +component that starts the embedded Jetty server, this component uses the +servlet provider of the container. + +Maven users will need to add the following dependency to +their `pom.xml` for this component: + +[source,xml] +------------------------------------------------------------ +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-atmosphere-websocket</artifactId> + <version>x.x.x</version> + <!-- use the same version as your Camel core version --> +</dependency> +------------------------------------------------------------ + +[[Atmosphere-Websocket-URIFormat]] +URI Format +^^^^^^^^^^ + +[source,java] +----------------------------------------------- +atmosphere-websocket:///relative path[?options] +----------------------------------------------- + +[[Atmosphere-Websocket-ReadingandWritingDataoverWebsocket]] +Reading and Writing Data over Websocket +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +An atmopshere-websocket endpoint can either write data to the socket or +read from the socket, depending on whether the endpoint is configured as +the producer or the consumer, respectively. + +[[Atmosphere-Websocket-ConfiguringURItoReadorWriteData]] +Configuring URI to Read or Write Data +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In the route below, Camel will read from the specified websocket +connection. + +[source,java] +------------------------------------------- +from("atmosphere-websocket:///servicepath") + .to("direct:next"); +------------------------------------------- + +And the equivalent Spring sample: + +[source,xml] +------------------------------------------------------------ +<camelContext xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="atmosphere-websocket:///servicepath"/> + <to uri="direct:next"/> + </route> +</camelContext> +------------------------------------------------------------ + +In the route below, Camel will read from the specified websocket +connection. + +[source,java] +--------------------------------------------------- +from("direct:next") + .to("atmosphere-websocket:///servicepath"); +--------------------------------------------------- + +And the equivalent Spring sample: + +[source,xml] +------------------------------------------------------------ +<camelContext xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="direct:next"/> + <to uri="atmosphere-websocket:///servicepath"/> + </route> +</camelContext> +------------------------------------------------------------ + + + +[[Atmosphere-Websocket-SeeAlso]] +See Also +^^^^^^^^ + +* link:configuring-camel.html[Configuring Camel] +* link:component.html[Component] +* link:endpoint.html[Endpoint] +* link:getting-started.html[Getting Started] + +* link:servlet.html[SERVLET] +* link:ahc-ws.html[AHC-WS] +* +https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=39621544[Websocket] + http://git-wip-us.apache.org/repos/asf/camel/blob/1783e696/docs/user-manual/en/SUMMARY.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index 275b1a0..78c0ae2 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -73,6 +73,7 @@ * [AHC Websocket (AHC-WS)](ahc-ws.adoc) * [Amqp](amqp.adoc) * [Apns](apns.adoc) + * [Atmosphere Websocket](atmosphere-websocket.adoc) * [Atom](atom.adoc) * [CDI](cdi.adoc) * [JMS](jms.adoc)
