From 9a70f121d7cd729541389ac3ac7f02e0483ac4d5 Mon Sep 17 00:00:00 2001 From: WSO2 Builder Date: Tue, 29 Oct 2019 13:30:11 +0000 Subject: [PATCH] [WSO2-Release] [Release 2.0.8] update documentation for release 2.0.8 --- README.md | 6 +- docs/api/2.0.8.md | 183 +++++++++++++++++++++++++++++++++++++++++++++ docs/api/latest.md | 10 ++- docs/index.md | 6 +- mkdocs.yml | 1 + 5 files changed, 199 insertions(+), 7 deletions(-) create mode 100644 docs/api/2.0.8.md diff --git a/README.md b/README.md index 9f40254..ce5967e 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ For information on Siddhi and i ## Latest API Docs -Latest API Docs is 2.0.7. +Latest API Docs is 2.0.8. ## Features -* nats *(Sink)*

NATS Sink allows users to subscribe to a NATS broker and publish messages.

-* nats *(Source)*

NATS Source allows users to subscribe to a NATS broker and receive messages. It has the ability to receive all the message types supported by NATS.

+* nats *(Sink)*

NATS Sink allows users to subscribe to a NATS broker and publish messages.

+* nats *(Source)*

NATS Source allows users to subscribe to a NATS broker and receive messages. It has the ability to receive all the message types supported by NATS.

## Dependencies diff --git a/docs/api/2.0.8.md b/docs/api/2.0.8.md new file mode 100644 index 0000000..c9f2230 --- /dev/null +++ b/docs/api/2.0.8.md @@ -0,0 +1,183 @@ +# API Docs - v2.0.8 + +!!! Info "Tested Siddhi Core version: *5.1.5*" + It could also support other Siddhi Core minor versions. + +## Sink + +### nats *(Sink)* +

+

NATS Sink allows users to subscribe to a NATS broker and publish messages.

+

+Syntax + +``` +@sink(type="nats", destination="", bootstrap.servers="", client.id="", cluster.id="", @map(...))) +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
destination

Subject name which NATS sink should publish to.

STRINGNoYes
bootstrap.servers

The NATS based url of the NATS server.

nats://localhost:4222STRINGYesNo
client.id

The identifier of the client publishing/connecting to the NATS broker. Should be unique for each client connecting to the server/cluster.

NoneSTRINGYesNo
cluster.id

The identifier of the NATS server/cluster.

test-clusterSTRINGYesNo
+ +Examples +EXAMPLE 1 +``` +@sink(type='nats', @map(type='xml'), destination='SP_NATS_OUTPUT_TEST', bootstrap.servers='nats://localhost:4222',client.id='nats_client',server.id='test-cluster') +define stream outputStream (name string, age int, country string); +``` +

+

This example shows how to publish to a NATS subject with all supporting configurations. With the following configuration the sink identified as 'nats-client' will publish to a subject named as 'SP_NATS_OUTPUT_TEST' which resides in a nats instance with a cluster id of 'test-cluster', running in localhost and listening to the port 4222 for client connection.

+

+EXAMPLE 2 +``` +@sink(type='nats', @map(type='xml'), destination='SP_NATS_OUTPUT_TEST') +define stream outputStream (name string, age int, country string); +``` +

+

This example shows how to publish to a NATS subject with mandatory configurations. With the following configuration the sink identified with an auto generated client id will publish to a subject named as 'SP_NATS_OUTPUT_TEST' which resides in a nats instance with a cluster id of 'test-cluster', running in localhost and listening to the port 4222 for client connection.

+

+## Source + +### nats *(Source)* +

+

NATS Source allows users to subscribe to a NATS broker and receive messages. It has the ability to receive all the message types supported by NATS.

+

+Syntax + +``` +@source(type="nats", destination="", bootstrap.servers="", client.id="", cluster.id="", queue.group.name="", durable.name="", subscription.sequence="", @map(...))) +``` + +QUERY PARAMETERS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
destination

Subject name which NATS Source should subscribe to.

STRINGNoNo
bootstrap.servers

The NATS based url of the NATS server.

nats://localhost:4222STRINGYesNo
client.id

The identifier of the client subscribing/connecting to the NATS broker.

NoneSTRINGYesNo
cluster.id

The identifier of the NATS server/cluster.

test-clusterSTRINGYesNo
queue.group.name

This can be used when there is a requirement to share the load of a NATS subject. Clients belongs to the same queue group share the subscription load.

NoneSTRINGYesNo
durable.name

This can be used to subscribe to a subject from the last acknowledged message when a client or connection failure happens. The client can be uniquely identified using the tuple (client.id, durable.name).

NoneSTRINGYesNo
subscription.sequence

This can be used to subscribe to a subject from a given number of message sequence. All the messages from the given point of sequence number will be passed to the client. If not provided then the either the persisted value or 0 will be used.

NoneSTRINGYesNo
+ +Examples +EXAMPLE 1 +``` +@source(type='nats', @map(type='text'), destination='SP_NATS_INPUT_TEST', bootstrap.servers='nats://localhost:4222',client.id='nats_client',server.id='test-cluster',queue.group.name = 'group_nats',durable.name = 'nats-durable',subscription.sequence = '100') +define stream inputStream (name string, age int, country string); +``` +

+

This example shows how to subscribe to a NATS subject with all supporting configurations.With the following configuration the source identified as 'nats-client' will subscribes to a subject named as 'SP_NATS_INPUT_TEST' which resides in a nats instance with a cluster id of 'test-cluster', running in localhost and listening to the port 4222 for client connection. This subscription will receive all the messages from 100th in the subject.

+

+EXAMPLE 2 +``` +@source(type='nats', @map(type='text'), destination='SP_NATS_INPUT_TEST', ) +define stream inputStream (name string, age int, country string); +``` +

+

This example shows how to subscribe to a NATS subject with mandatory configurations.With the following configuration the source identified with an auto generated client id will subscribes to a subject named as 'SP_NATS_INTPUT_TEST' which resides in a nats instance with a cluster id of 'test-cluster', running in localhost and listening to the port 4222 for client connection. This will receive all available messages in the subject

+

+EXAMPLE 3 +``` +@source(type='nats', @map(type='json', @attributes(name='$.name', age='$.age', country='$.country', sequenceNum='trp:sequenceNumber')), destination='SIDDHI_NATS_SOURCE_TEST_DEST', client.id='nats_client', bootstrap.servers='nats://localhost:4222', cluster.id='test-cluster') +define stream inputStream (name string, age int, country string, sequenceNum string); +``` +

+

This example shows how to pass NATS Streaming sequence number to the event.

+

diff --git a/docs/api/latest.md b/docs/api/latest.md index 2ed955f..c9f2230 100644 --- a/docs/api/latest.md +++ b/docs/api/latest.md @@ -1,4 +1,4 @@ -# API Docs - v2.0.7 +# API Docs - v2.0.8 !!! Info "Tested Siddhi Core version: *5.1.5*" It could also support other Siddhi Core minor versions. @@ -173,3 +173,11 @@ define stream inputStream (name string, age int, country string);

This example shows how to subscribe to a NATS subject with mandatory configurations.With the following configuration the source identified with an auto generated client id will subscribes to a subject named as 'SP_NATS_INTPUT_TEST' which resides in a nats instance with a cluster id of 'test-cluster', running in localhost and listening to the port 4222 for client connection. This will receive all available messages in the subject

+EXAMPLE 3 +``` +@source(type='nats', @map(type='json', @attributes(name='$.name', age='$.age', country='$.country', sequenceNum='trp:sequenceNumber')), destination='SIDDHI_NATS_SOURCE_TEST_DEST', client.id='nats_client', bootstrap.servers='nats://localhost:4222', cluster.id='test-cluster') +define stream inputStream (name string, age int, country string, sequenceNum string); +``` +

+

This example shows how to pass NATS Streaming sequence number to the event.

+

diff --git a/docs/index.md b/docs/index.md index 9f40254..ce5967e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,12 +19,12 @@ For information on Siddhi and i ## Latest API Docs -Latest API Docs is 2.0.7. +Latest API Docs is 2.0.8. ## Features -* nats *(Sink)*

NATS Sink allows users to subscribe to a NATS broker and publish messages.

-* nats *(Source)*

NATS Source allows users to subscribe to a NATS broker and receive messages. It has the ability to receive all the message types supported by NATS.

+* nats *(Sink)*

NATS Sink allows users to subscribe to a NATS broker and publish messages.

+* nats *(Source)*

NATS Source allows users to subscribe to a NATS broker and receive messages. It has the ability to receive all the message types supported by NATS.

## Dependencies diff --git a/mkdocs.yml b/mkdocs.yml index 11cd311..53e072d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,6 +34,7 @@ pages: - Information: index.md - API Docs: - latest: api/latest.md + - 2.0.8: api/2.0.8.md - 2.0.7: api/2.0.7.md - 2.0.6: api/2.0.6.md - 2.0.5: api/2.0.5.md