Skip to content

Commit

Permalink
fixed source docs (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabo1208 authored May 19, 2022
1 parent 64ec508 commit e1cf794
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions docs/source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Or if you want to run the latest version from this repo, you can use [`ko`](http
- Install the `ko` CLI for building and deploying purposes.

```shell script
go get github.com/google/go-containerregistry/cmd/ko
go install github.com/google/ko@latest
```

- Configure container registry, such as a Docker Hub account, is required.
Expand Down Expand Up @@ -97,6 +97,8 @@ spec:
secretKeyRef:
name: rabbitmq-default-user
key: password
connectionSecret:
name: rabbitmq-default-user # used when exchange and queue are not predeclared
channelConfig:
globalQos: false
exchangeConfig:
Expand All @@ -115,7 +117,9 @@ EOF

## Published Events

All messages received by the source are published with the following schema:
All messages received by the source are published in binary mode with the following schema:

If it is already a CloudEvent, the message is forwarded in binary mode. If it isn't:

Event attributes
| Attribute | Value | Notes |
Expand All @@ -124,8 +128,8 @@ Event attributes
| `source` | `/apis/v1/namespace/*$NS*/rabbitmqsources/*$NAME*#*$QUEUE_NAME*` | `NS`, `NAME` and `QUEUE_NAME` are derived from the source configuration |
| `id` | A unique ID | This uses the `MessageId` if available, and a UUID otherwise |
| `subject` | The ID of the message | Empty string if no message ID is present |
| `datacontenttype` | `application/json` | Currently static |
| `key` | The ID of the message | Empty string if no message ID is present |
| `content-type` | Extracted from the RabbitMQ `MessageContentType` | Any valid Content Type |
| `time` | A timestamp | This uses the `MessageTimestamp` if Available |

The payload of the event is set to the data content of the message.

Expand All @@ -149,9 +153,8 @@ The source sends the following event content:
"source": "/apis/v1/namespaces/default/rabbitmqsources/rabbitmq-source",
"id": "f00c1f52-33a1-4d3d-993f-750f20c804da",
"time": "2020-12-18T01:15:20.450860898Z",
"subject": "",
"subject": "f00c1f52-33a1-4d3d-993f-750f20c804da",
"datacontenttype": "application/json",
"key": "",
"data": "Hello rabbitmq!"
}
```
Expand All @@ -164,11 +167,15 @@ Sources are Kubernetes objects. In addition to the standard Kubernetes
Source parameters
| Field | Value |
|--------|--------|
| `spec.broker` | Host+Port of the Broker, with a trailing "/" |
| `spec.vhost` * | VHost where the source resources are located |
| `spec.predeclared` | Defines if the source should try to create new queue or use predeclared one (Boolean) |
| `broker` | Host+Port of the Broker, with a trailing "/" |
| `vhost` * | VHost where the source resources are located |
| `predeclared` | Defines if the source should try to create new queue or use predeclared one (Boolean) |
| `backoffPolicy` | The backoff policy type (linear, exponential) String |
| `backoffDelay` | Is the delay to be used before retrying by the backoff policy (String) |
| `retry` | Number of retries to be used by the backoff policy (Int) |
| `user.secretKeyRef` | Username for Broker authentication; field `key` in a Kubernetes Secret named `name` |
| `password.secretKeyRef` | Password for Broker authentication; field `key` in a Kubernetes Secret named `name` |
| `connectionSecret` | The name of the RabbitMQ secret |
| `exchangeConfig` | Settings for the exchange |
| `exchangeConfig.name` * | Name of the exchange |
| `exchangeConfig.type` | [Exchange type](https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchanges). Can be `fanout`, `direct`, `topic`, `match` or `headers` |
Expand All @@ -182,6 +189,7 @@ Source parameters
| `channelConfig.parallelism` * | Int that sets the [Consumer Prefetch Value](https://www.rabbitmq.com/consumer-prefetch.html) and creates `n` parallel consumer processes. Default value is `1`. Value must be between `1` and `1000`. With a value of `1` the RabbitMQ Source process events in FIFO order, values above `1` break message ordering guarantees and can be seen as more performance oriented. |
| `channelConfig.globalQos` * | Boolean defining how the [Consumer Sharing Limit](https://www.rabbitmq.com/consumer-prefetch.html#sharing-the-limit) is handled. |
| `sink` | A reference to an [Addressable](https://knative.dev/docs/eventing/#event-consumers) Kubernetes object |
| `serviceAccountName` | The service account name to be used by the Receive Adapter deployments generated by the Source |

`*` These attributes are optional.

Expand All @@ -195,6 +203,8 @@ kubectl create secret generic rabbitmq-secret \
--from-file=password=/tmp/password
```

* To edit the Source's default user secret and add the the RabbitMQ http uri, see the [Source's samples Readme](../../samples/source/README.md)

Note that many parameters do not need to be specified. Unspecified optional
parameters will be defaulted to `false` or `""` (empty string).

Expand Down
Binary file modified docs/source/rabbitmq-knative-source.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e1cf794

Please sign in to comment.