Merge branch 'master' into brooke/postgresdocs

This commit is contained in:
Brooke Hamilton 2020-07-10 17:42:23 -04:00 committed by GitHub
commit d19101b060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 5 deletions

View File

@ -34,8 +34,22 @@ We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Ku
4. Next, we'll get our Redis password, which is slightly different depending on the OS we're using:
- **Windows**: Run `kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}" > encoded.b64`, which will create a file with your encoded password. Next, run `certutil -decode encoded.b64 password.txt`, which will put your redis password in a text file called `password.txt`. Copy the password and delete the two files.
- **Windows**: Run below commands
```powershell
# Create a file with your encoded password.
kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}" > encoded.b64
# put your redis password in a text file called `password.txt`.
certutil -decode encoded.b64 password.txt
# Copy the password and delete the two files.
```
- **Windows**: If you are using Powershell, it would be even easier.
```powershell
PS C:\> $base64pwd=kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}"
PS C:\> $redispassword=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($base64pwd))
PS C:\> $base64pwd=""
PS C:\> $redispassword
```
- **Linux/MacOS**: Run `kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}" | base64 --decode` and copy the outputted password.
Add this password as the `redisPassword` value in your [redis.yaml](#configuration) file. For example:

View File

@ -20,19 +20,33 @@ spec:
- name: connectionString
value: <REPLACE-WITH-CONNECTION-STRING> # Required.
- name: timeoutInSec
value: <REPLACE-WITH-TIMEOUT-IN-SEC> # Optional. Default: "60".
value: <REPLACE-WITH-TIMEOUT-IN-SEC> # Optional. Default: "60". Timeout for sending messages and management operations.
- name: handlerTimeoutInSec
value: <REPLACE-WITH-HANDLER-TIMEOUT-IN-SEC> # Optional. Default: "60". Timeout for invoking app handler.
- name: disableEntityManagement
value: <REPLACE-WITH-DISABLE-ENTITY-MANAGEMENT> # Optional. Default: false. When set to true, topics and subscriptions do not get created automatically.
- name: maxDeliveryCount
value: <REPLACE-WITH-MAX-DELIVERY-COUNT> # Optional.
value: <REPLACE-WITH-MAX-DELIVERY-COUNT> # Optional. Defines the number of attempts the server will make to deliver a message.
- name: lockDurationInSec
value: <REPLACE-WITH-LOCK-DURATION-IN-SEC> # Optional.
value: <REPLACE-WITH-LOCK-DURATION-IN-SEC> # Optional. Defines the length in seconds that a message will be locked for before expiring.
- name: lockRenewalInSec
value: <REPLACE-WITH-LOCK-RENEWAL-IN-SEC> # Optional. Default: "20". Defines the frequency at which buffered message locks will be renewed.
- name: maxActiveMessages
value: <REPLACE-WITH-MAX-ACTIVE-MESSAGES> # Optional. Default: "10000". Defines the maximum number of messages to be buffered or processing at once.
- name: maxActiveMessagesRecoveryInSec
value: <REPLACE-WITH-MAX-ACTIVE-MESSAGES-RECOVERY-IN-SEC> # Optional. Default: "2". Defines the number of seconds to wait once the maximum active message limit is reached.
- name: maxConcurrentHandlers
valye: <REPLACE-WITH-MAX-CONCURRENT-HANDLERS> # Optional. Defines the maximum number of concurrent message handlers
- name: prefetchCount
value: <REPLACE-WITH-PREFETCH-COUNT> # Optional. Defines the number of prefetched messages (use for high throughput / low latency scenarios)
- name: defaultMessageTimeToLiveInSec
value: <REPLACE-WITH-MESSAGE-TIME-TO-LIVE-IN-SEC> # Optional.
- name: autoDeleteOnIdleInSec
value: <REPLACE-WITH-AUTO-DELETE-ON-IDLE-IN-SEC> # Optional.
```
> __NOTE:__ The above settings are shared across all topics that use this component.
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described [here](../../concepts/secrets/README.md)
## Apply the configuration

View File

@ -159,7 +159,7 @@ See the [different specs](../specs/bindings) on each binding to see the list of
### HTTP Request
```http
POST/GET/PUT/DELETE http://localhost:<daprPort>/v1.0/bindings/<name>
POST/PUT http://localhost:<daprPort>/v1.0/bindings/<name>
```
### HTTP Response codes

View File

@ -1,5 +1,7 @@
# Twitter Binding Spec
The Twitter binding supports both `input` and `output` binding configuration. First the common part:
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
@ -17,6 +19,42 @@ spec:
value: "****" # twitter api access token, required
- name: accessSecret
value: "****" # twitter api access secret, required
```
For input bindings, where the query matching Tweets are streamed to the user service, the above component has to also include a query:
```yaml
- name: query
value: "dapr" # your search query, required
```
For output binding invocation the user code has to invoke the binding:
```shell
POST http://localhost:3500/v1.0/bindings/twitter
```
Where the payload is:
```json
{
"data": "",
"metadata": {
"query": "twitter-query",
"lang": "optional-language-code",
"result": "valid-result-type"
},
"operation": "get"
}
```
The metadata parameters are:
* `query` - any valid Twitter query (e.g. `dapr` or `dapr AND serverless`). See [Twitter docs](https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators) for more details on advanced query formats
* `lang` - (optional, default: `en`) restricts result tweets to the given language using [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
* `result` - (optional, default: `recent`) specifies tweet query result type. Valid values include:
* `mixed` - both popular and real time results
* `recent` - most recent results
* `popular` - most popular results
You can see the example of the JSON data that Twitter binding returns [here](https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets)