Added camel-nats 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/af737a18
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/af737a18
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/af737a18

Branch: refs/heads/master
Commit: af737a1822affe32cf2598b86a32b5d748f13efa
Parents: 66f0fe8
Author: Andrea Cosentino <anco...@gmail.com>
Authored: Sun Apr 3 12:11:21 2016 +0200
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Sun Apr 3 12:19:54 2016 +0200

----------------------------------------------------------------------
 components/camel-nats/src/main/docs/nats.adoc | 98 ++++++++++++++++++++++
 docs/user-manual/en/SUMMARY.md                |  1 +
 2 files changed, 99 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/af737a18/components/camel-nats/src/main/docs/nats.adoc
----------------------------------------------------------------------
diff --git a/components/camel-nats/src/main/docs/nats.adoc 
b/components/camel-nats/src/main/docs/nats.adoc
new file mode 100644
index 0000000..a8716d6
--- /dev/null
+++ b/components/camel-nats/src/main/docs/nats.adoc
@@ -0,0 +1,98 @@
+[[NATS-NATSComponent]]
+NATS Component
+~~~~~~~~~~~~~~
+
+*Available since Camel 2.17.0*
+
+http://nats.io/[NATS] is a fast and reliable messaging platform.
+
+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-nats</artifactId>
+    <!-- use the same version as your Camel core version -->
+    <version>x.y.z</version>
+</dependency>
+------------------------------------------------------------
+
+[[NATS-URIformat]]
+URI format
+^^^^^^^^^^
+
+[source,java]
+----------------------
+nats:servers[?options]
+----------------------
+
+Where *servers* represents the list of NATS servers.
+
+[[NATS-Options]]
+Options
+^^^^^^^
+
+
+// component options: START
+The Nats component has no options.
+// component options: END
+
+
+
+// endpoint options: START
+The Nats component supports 17 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| servers | common |  | String | *Required* URLs to one or more NAT servers. 
Use comma to separate URLs when specifying multiple servers.
+| maxReconnectAttempts | common | 3 | int | Max reconnection attempts
+| noRandomizeServers | common | false | boolean | Whether or not randomizing 
the order of servers for the connection attempts
+| pedantic | common | false | boolean | Whether or not running in pedantic 
mode (this affects performace)
+| pingInterval | common | 4000 | int | Ping interval to be aware if connection 
is still alive (in milliseconds)
+| reconnect | common | true | boolean | Whether or not using reconnection 
feature
+| reconnectTimeWait | common | 2000 | int | Waiting time before attempts 
reconnection (in milliseconds)
+| ssl | common | false | boolean | Whether or not using SSL
+| topic | common |  | String | *Required* The name of topic we want to use
+| verbose | common | false | boolean | Whether or not running in verbose mode
+| bridgeErrorHandler | consumer | false | 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.
+| maxMessages | consumer |  | String | Stop receiving messages from a topic we 
are subscribing to after maxMessages
+| poolSize | consumer | 10 | int | Consumer pool size
+| queueName | consumer |  | String | The Queue name if we are using nats for a 
queue configuration
+| exceptionHandler | consumer (advanced) |  | 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 | advanced | InOnly | ExchangePattern | Sets the default 
exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous 
processing should be strictly used or Camel is allowed to use asynchronous 
processing (if supported).
+|=======================================================================
+// endpoint options: END
+
+
+[[NATS-Headers]]
+Headers
+^^^^^^^
+
+[width="100%",cols="10%,10%,80%",options="header",]
+|=======================================================================
+|Name |Type |Description
+
+|CamelNatsMessageTimestamp |long |The timestamp of a consumed message.
+
+|CamelNatsSubscriptionId |Integer |The subscription ID of a consumer.
+|=======================================================================
+ 
+*Producer example:*
+
+[source,java]
+-----------------------------------------------------------
+from("direct:send").to("nats://localhost:4222?topic=test");
+-----------------------------------------------------------
+
+ 
+
+*Consumer example:*
+
+[source,java]
+----------------------------------------------------------------------------------------
+from("nats://localhost:4222?topic=test&maxMessages=5&queueName=test").to("mock:result");
+----------------------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/camel/blob/af737a18/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 51bd3f0..146fb02 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -153,6 +153,7 @@
     * [JSON](json.adoc)
     * [Metrics](metrics.adoc)
     * [Mock](mock.adoc)
+    * [NATS](nats.adoc)
     * [Properties](properties.adoc)
     * [Quickfix](quickfix.adoc)
     * [SJMS](sjms.adoc)

Reply via email to