rgw: pubsub update documentation with amqp support

Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
This commit is contained in:
Yuval Lifshitz 2019-01-24 19:55:25 +02:00
parent 10492ccbba
commit 1682e1917e

View File

@ -7,8 +7,8 @@ PubSub Sync Module
This sync module provides a publish and subscribe mechanism for the object store modification
events. Events are published into defined topics. Topics can be subscribed to, and events
can be pulled from them. Events need to be acked. Also, events will expire and disappear
after a period of time. A basic push notification mechanism exists too, but it is not
reliable.
after a period of time. A push notification mechanism exists too, currently supporting HTTP and
AMQP0.9.1 endpoints.
A user can create different topics. A topic entity is defined by its user and its name. A
user can only manage its own topics, and can only subscribe to events published by buckets
@ -57,7 +57,7 @@ The uid of the pubsub control user.
The prefix of the bucket name that will be created to store events for specific topic.
* ``endpoint`` (string)
* ``data_oid_prefix`` (string)
The oid prefix for the stored events.
@ -99,11 +99,21 @@ the ``val`` specifies its new value. Nested values can be accessed using period.
A configuration field can be removed by using ``--tier-config-rm={key}``.
PubSub Performance Stats
-------------------------
- **pubsub_event_triggered**: running counter of events with at lease one pubsub topic associated with them
- **pubsub_event_lost**: running counter of events that had pubsub topics and subscriptions associated with them but that were not stored or pushed to any of the subscriptions
- **pubsub_store_ok**: running counter, for all subscriptions, of stored pubsub events
- **pubsub_store_fail**: running counter, for all subscriptions, of pubsub events that needed to be stored but failed
- **pubsub_push_ok**: running counter, for all subscriptions, of pubsub events successfully pushed to their endpoint
- **pubsub_push_fail**: running counter, for all subscriptions, of pubsub events failed to be pushed to their endpoint
- **pubsub_push_pending**: gauge value of pubsub events pushed to a endpoined but not acked or nacked yet
Note that **pubsub_event_triggered** and **pubsub_event_lost** are incremented per event, while: **pubsub_store_ok**, **pubsub_store_fail**, **pubsub_push_ok**, **pubsub_push_fail**, are incremented per store/push action on each subscriptions.
PubSub REST API
-------------------------
.. versionadded:: Luminous
Topics
~~~~~~
@ -189,13 +199,19 @@ Creates a new subscription.
::
PUT /subscriptions/<sub-name>?topic=<topic-name>[&push-endpoint=<endpoint>]
PUT /subscriptions/<sub-name>?topic=<topic-name>[&push-endpoint=<endpoint>[&amqp-exchange=<exchange>][&amqp-ack-level=<level>]]
Request Params:
- topic-name: name of topic
- push-endpoint: url of endpoint to send push notification to
- push-endpoint: URI of endpoint to send push notification to
- URI schema is: ``http|amqp://[<user>:<password>@]<fqdn>[:<port>][/<amqp-vhost>]``
- Same schema is used for HTTP and AMQP endpoints (except amqp-vhost which is specific to AMQP)
- Default values for HTTP: no user/password, port 80
- Default values for AMQP: user/password=guest/guest, port 5672, amqp-vhost is "/"
- amqp-exchange: mandatory parameter for AMQP endpoint. The exchanges must exist and be able to route messages based on topics
- amqp-ack-level: 2 ack levels exist: "none" - message is considered "delivered" if sent to broker;
"broker" message is considered "delivered" if acked by broker.
No end2end acking is required, as messages may persist in the broker before delivered into their final destination
Get Subscription Info
````````````````````````````````````
@ -247,4 +263,4 @@ Ack event so that it can be removed from the subscription history.
Request Params:
- event-id: id of event to be acked
.. _Multisite Configuration: ./multisite
.. _Multisite Configuration: ./multisite.rst