Skip to content

Commit 87e7232

Browse files
authored
Merge branch 'v1.16' into add-clickhouse-state-store-docs-v1.16
2 parents 2da4c1d + 246316c commit 87e7232

File tree

3 files changed

+155
-2
lines changed

3 files changed

+155
-2
lines changed

daprdocs/content/en/reference/components-reference/supported-bindings/gcpbucket.md

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ This component supports **output binding** with the following operations:
7777

7878
- `create` : [Create file](#create-file)
7979
- `get` : [Get file](#get-file)
80+
- `bulkGet` : [Bulk get objects](#bulk-get-objects)
8081
- `delete` : [Delete file](#delete-file)
8182
- `list`: [List file](#list-files)
83+
- `copy`: [Copy file](#copy-files)
84+
- `move`: [Move file](#move-files)
85+
- `rename`: [Rename file](#rename-files)
86+
8287

8388
### Create file
8489

@@ -211,6 +216,72 @@ The metadata parameters are:
211216

212217
The response body contains the value stored in the object.
213218

219+
### Bulk get objects
220+
221+
To perform a bulk get operation that retrieves all bucket files at once, invoke the GCP bucket binding with a `POST` method and the following JSON body:
222+
223+
```json
224+
{
225+
"operation": "bulkGet",
226+
}
227+
```
228+
229+
The metadata parameters are:
230+
231+
- `encodeBase64` - (optional) configuration to encode base64 file content before return the content for all files
232+
233+
#### Example
234+
235+
{{< tabs Windows Linux >}}
236+
237+
{{% codetab %}}
238+
```bash
239+
curl -d '{ \"operation\": \"bulkget\"}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
240+
```
241+
{{% /codetab %}}
242+
243+
{{% codetab %}}
244+
```bash
245+
curl -d '{ "operation": "bulkget"}' \
246+
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
247+
```
248+
{{% /codetab %}}
249+
250+
{{< /tabs >}}
251+
252+
#### Response
253+
254+
The response body contains an array of objects, where each object represents a file in the bucket with the following structure:
255+
256+
```json
257+
[
258+
{
259+
"name": "file1.txt",
260+
"data": "content of file1",
261+
"attrs": {
262+
"bucket": "mybucket",
263+
"name": "file1.txt",
264+
"size": 1234,
265+
...
266+
}
267+
},
268+
{
269+
"name": "file2.txt",
270+
"data": "content of file2",
271+
"attrs": {
272+
"bucket": "mybucket",
273+
"name": "file2.txt",
274+
"size": 5678,
275+
...
276+
}
277+
}
278+
]
279+
```
280+
281+
Each object in the array contains:
282+
- `name`: The name of the file
283+
- `data`: The content of the file
284+
- `attrs`: Object attributes from GCP Storage including metadata like creation time, size, content type, etc.
214285

215286
### Delete object
216287

@@ -257,7 +328,7 @@ An HTTP 204 (No Content) and empty body will be retuned if successful.
257328

258329
### List objects
259330

260-
To perform a list object operation, invoke the S3 binding with a `POST` method and the following JSON body:
331+
To perform a list object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
261332

262333
```json
263334
{
@@ -316,6 +387,58 @@ The list of objects will be returned as JSON array in the following form:
316387
}
317388
]
318389
```
390+
391+
### Copy objects
392+
393+
To perform a copy object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
394+
395+
```json
396+
{
397+
"operation": "copy",
398+
"metadata": {
399+
"destinationBucket": "destination-bucket-name",
400+
}
401+
}
402+
```
403+
404+
The metadata parameters are:
405+
406+
- `destinationBucket` - the name of the destination bucket (required)
407+
408+
### Move objects
409+
410+
To perform a move object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
411+
412+
```json
413+
{
414+
"operation": "move",
415+
"metadata": {
416+
"destinationBucket": "destination-bucket-name",
417+
}
418+
}
419+
```
420+
421+
The metadata parameters are:
422+
423+
- `destinationBucket` - the name of the destination bucket (required)
424+
425+
### Rename objects
426+
427+
To perform a rename object operation, invoke the GCP bucket binding with a `POST` method and the following JSON body:
428+
429+
```json
430+
{
431+
"operation": "rename",
432+
"metadata": {
433+
"newName": "object-new-name",
434+
}
435+
}
436+
```
437+
438+
The metadata parameters are:
439+
440+
- `newName` - the new name of the object (required)
441+
319442
## Related links
320443

321444
- [Basic schema for a Dapr component]({{< ref component-schema >}})

daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ spec:
5959
value: 2097152
6060
- name: channelBufferSize # Optional. Advanced setting. The number of events to buffer in internal and external channels.
6161
value: 512
62+
- name: consumerGroupRebalanceStrategy # Optional. Advanced setting. The strategy to use for consumer group rebalancing.
63+
value: sticky
6264
- name: schemaRegistryURL # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry URL.
6365
value: http://localhost:8081
6466
- name: schemaRegistryAPIKey # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry API Key.
@@ -69,6 +71,8 @@ spec:
6971
value: true
7072
- name: schemaLatestVersionCacheTTL # Optional. When using Schema Registry Avro serialization/deserialization. The TTL for schema caching when publishing a message with latest schema available.
7173
value: 5m
74+
- name: useAvroJson # Optional. Enables Avro JSON schema for serialization as opposed to Standard JSON default. Only applicable when the subscription uses valueSchemaType=Avro
75+
value: "true"
7276
- name: escapeHeaders # Optional.
7377
value: false
7478

@@ -115,13 +119,15 @@ spec:
115119
| schemaRegistryAPISecret | N | When using Schema Registry Avro serialization/deserialization. The Schema Registry credentials API Secret. | `ABCDEFGMEADFF` |
116120
| schemaCachingEnabled | N | When using Schema Registry Avro serialization/deserialization. Enables caching for schemas. Default is `true` | `true` |
117121
| schemaLatestVersionCacheTTL | N | When using Schema Registry Avro serialization/deserialization. The TTL for schema caching when publishing a message with latest schema available. Default is 5 min | `5m` |
122+
| useAvroJson | N | Enables Avro JSON schema for serialization as opposed to Standard JSON default. Only applicable when the subscription uses valueSchemaType=Avro. Default is `"false"` | `"true"` |
118123
| clientConnectionTopicMetadataRefreshInterval | N | The interval for the client connection's topic metadata to be refreshed with the broker as a Go duration. Defaults to `9m`. | `"4m"` |
119124
| clientConnectionKeepAliveInterval | N | The maximum time for the client connection to be kept alive with the broker, as a Go duration, before closing the connection. A zero value (default) means keeping alive indefinitely. | `"4m"` |
120125
| consumerFetchMin | N | The minimum number of message bytes to fetch in a request - the broker will wait until at least this many are available. The default is `1`, as `0` causes the consumer to spin when no messages are available. Equivalent to the JVM's `fetch.min.bytes`. | `"2"` |
121126
| consumerFetchDefault | N | The default number of message bytes to fetch from the broker in each request. Default is `"1048576"` bytes. | `"2097152"` |
122127
| channelBufferSize | N | The number of events to buffer in internal and external channels. This permits the producer and consumer to continue processing some messages in the background while user code is working, greatly improving throughput. Defaults to `256`. | `"512"` |
123128
| heartbeatInterval | N | The interval between heartbeats to the consumer coordinator. At most, the value should be set to a 1/3 of the `sessionTimeout` value. Defaults to "3s". | `"5s"` |
124129
| sessionTimeout | N | The timeout used to detect client failures when using Kafka’s group management facility. If the broker fails to receive any heartbeats from the consumer before the expiration of this session timeout, then the consumer is removed and initiates a rebalance. Defaults to "10s". | `"20s"` |
130+
| consumerGroupRebalanceStrategy | N | The strategy to use for consumer group rebalancing. Supported values: `range`, `sticky`, `roundrobin`. Default is `range` | `"sticky"` |
125131
| escapeHeaders | N | Enables URL escaping of the message header values received by the consumer. Allows receiving content with special characters that are usually not allowed in HTTP headers. Default is `false`. | `true` |
126132

127133
The `secretKeyRef` above is referencing a [kubernetes secrets store]({{< ref kubernetes-secret-store.md >}}) to access the tls information. Visit [here]({{< ref setup-secret-store.md >}}) to learn more about how to configure a secret store component.
@@ -583,7 +589,12 @@ You can configure pub/sub to publish or consume data encoded using [Avro binary
583589

584590
{{% alert title="Important" color="warning" %}}
585591
Currently, only message value serialization/deserialization is supported. Since cloud events are not supported, the `rawPayload=true` metadata must be passed when publishing Avro messages.
592+
586593
Please note that `rawPayload=true` should NOT be set for consumers, as the message value will be wrapped into a CloudEvent and base64-encoded. Leaving `rawPayload` as default (i.e. `false`) will send the Avro-decoded message to the application as a JSON payload.
594+
595+
When setting the `useAvroJson` component metadata to `true`, the inbound/outbound Avro binary is converted into/from Avro JSON encoding.
596+
This can be preferable when accurate type mapping is desirable.
597+
The default is standard JSON which is typically easier to bind to a native type in an application.
587598
{{% /alert %}}
588599

589600
When configuring the Kafka pub/sub component metadata, you must define:
@@ -671,7 +682,25 @@ app.include_router(router)
671682

672683
{{< /tabs >}}
673684

674-
685+
### Overriding default consumer group rebalancing
686+
In Kafka, rebalancing strategies determine how partitions are assigned to consumers within a consumer group. The default strategy is "range", but "roundrobin" and "sticky" are also available.
687+
- `Range`:
688+
Partitions are assigned to consumers based on their lexicographical order.
689+
If you have three partitions (0, 1, 2) and two consumers (A, B), consumer A might get partitions 0 and 1, while consumer B gets partition 2.
690+
- `RoundRobin`:
691+
Partitions are assigned to consumers in a round-robin fashion.
692+
With the same example above, consumer A might get partitions 0 and 2, while consumer B gets partition 1.
693+
- `Sticky`:
694+
This strategy aims to preserve previous assignments as much as possible while still maintaining a balanced distribution.
695+
If a consumer leaves or joins the group, only the affected partitions are reassigned, minimizing disruption.
696+
697+
#### Choosing a Strategy:
698+
- `Range`:
699+
Simple to understand and implement, but can lead to uneven distribution if partition sizes vary significantly.
700+
- `RoundRobin`:
701+
Provides a good balance in many cases, but might not be optimal if message keys are unevenly distributed.
702+
- `Sticky`:
703+
Generally preferred for its ability to minimize disruption during rebalances, especially when dealing with a large number of partitions or frequent consumer group changes.
675704

676705
## Create a Kafka instance
677706

daprdocs/content/en/reference/components-reference/supported-pubsub/setup-pulsar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ The above example uses secrets as plain strings. It is recommended to use a [sec
9292
| processMode | N | Enable processing multiple messages at once. Default: `"async"` | `"async"`, `"sync"`|
9393
| subscribeType | N | Pulsar supports four kinds of [subscription types](https://pulsar.apache.org/docs/3.0.x/concepts-messaging/#subscription-types). Default: `"shared"` | `"shared"`, `"exclusive"`, `"failover"`, `"key_shared"`|
9494
| subscribeInitialPosition | N | Subscription position is the initial position which the cursor is set when start consuming. Default: `"latest"` | `"latest"`, `"earliest"` |
95+
| subscribeMode | N | Subscription mode indicates the cursor persistence, durable subscription retains messages and persists the current position. Default: `"durable"` | `"durable"`, `"non_durable"` |
9596
| partitionKey | N | Sets the key of the message for routing policy. Default: `""` | |
9697
| `maxConcurrentHandlers` | N | Defines the maximum number of concurrent message handlers. Default: `100` | `10`
9798

0 commit comments

Comments
 (0)