Skip to content

Commit 2c7c636

Browse files
authored
Merge branch 'v1.17' into add-akeyless-doc
2 parents 6ab6cd8 + ba5f87c commit 2c7c636

File tree

3 files changed

+68
-3
lines changed

3 files changed

+68
-3
lines changed

.github/workflows/website-v1-17.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ jobs:
4747
HUGO_ENV: production
4848
HUGO_VERSION: "0.147.9"
4949
with:
50-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_16 }}
51-
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
50+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_17 }}
5251
skip_deploy_on_missing_secrets: true
52+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
5353
action: "upload"
5454
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
5555
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
@@ -66,6 +66,7 @@ jobs:
6666
id: closepullrequest
6767
uses: Azure/static-web-apps-deploy@v1
6868
with:
69-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_16 }}
69+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_17 }}
7070
skip_deploy_on_missing_secrets: true
71+
app_location: "/daprdocs/public" # App source code path
7172
action: "close"

daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-cloudevents.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,48 @@ Invoke-RestMethod -Method Post -ContentType 'application/cloudevents+json' -Body
239239

240240
{{< /tabpane >}}
241241

242+
### Publish binary CloudEvents
243+
244+
In binary mode, the transport payload only contains the event body, while
245+
CloudEvent attributes are supplied via transport metadata that begins with the
246+
`ce_` prefix (HTTP headers, Kafka headers, NATS headers, and so on). This is
247+
useful when you already produce binary mode events or you want to send arbitrary
248+
binary data without wrapping it in an additional JSON envelope.
249+
250+
To publish a binary CloudEvent to Dapr (via HTTP/gRPC publish APIs or directly
251+
into a broker that Dapr reads from):
252+
253+
1. Set the transport’s native content-type metadata (for example the HTTP
254+
`Content-Type` header or a Kafka `content-type` message header) to the MIME
255+
type that represents binary data, which is `application/octet-stream`.
256+
257+
2. Add the required CloudEvent attributes (`ce_specversion`, `ce_type`,
258+
`ce_source`, `ce_id`) as transport metadata. Optional attributes such as
259+
`ce_subject`, `ce_time`, or `ce_traceparent` are also honored.
260+
261+
3. Send the payload bytes in the message body.
262+
263+
{{< tabpane text=true >}}
264+
265+
{{% tab "HTTP API (Bash)" %}}
266+
267+
Publish a Binary CloudEvent to orders topic:
268+
269+
```bash
270+
curl -X POST http://localhost:3500/v1.0/publish/order-pub-sub/orders \
271+
-H "Content-Type: application/octet-stream" \
272+
-H "ce_specversion: 1.0" \
273+
-H "ce_type: com.example.order.created" \
274+
-H "ce_source: urn:example:/checkout" \
275+
-H "ce_id: 2a8bbf52-1222-4c2c-85f0-8a8875c7bc10" \
276+
-H "ce_subject: orders/100" \
277+
--data-binary $'\x01\x02\x03\x04'
278+
```
279+
280+
{{% /tab %}}
281+
282+
{{< /tabpane >}}
283+
242284
## Event deduplication
243285

244286
When using cloud events created by Dapr, the envelope contains an `id` field which can be used by the app to perform message deduplication. Dapr does not handle deduplication automatically. Dapr supports using message brokers that natively enable message deduplication.

daprdocs/content/en/reference/api/pubsub_api.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,28 @@ HTTP Status | Description
300300
404 | error is logged and all messages are dropped
301301
other | warning is logged and all messages to be retried
302302

303+
#### CloudEvents binary mode
304+
305+
Supports publishing CloudEvents that use the binary mode defined by
306+
the CloudEvents HTTP binding. In this mode, the HTTP body only contains the
307+
payload bytes, and CloudEvent attributes are passed as headers with the `ce_`
308+
prefix. Provide the required headers (`ce_specversion`, `ce_type`, `ce_source`,
309+
`ce_id`) along with any optional ones (for example `ce_subject` or `ce_time`).
310+
Dapr copies the HTTP `Content-Type` header into the CloudEvent's
311+
`datacontenttype` attribute and forwards the resulting event to subscribers.
312+
313+
Example sending four raw bytes:
314+
315+
```bash
316+
curl -X POST http://localhost:3500/v1.0/publish/pubsubName/deathStarStatus \
317+
-H "Content-Type: application/octet-stream" \
318+
-H "ce_specversion: 1.0" \
319+
-H "ce_type: com.example.deathstar.status.changed" \
320+
-H "ce_source: urn:example:/deathstar" \
321+
-H "ce_id: 3a58b9b8-24d2-4f62-84f4-6177c2fe0633" \
322+
--data-binary $'\x01\x02\x03\x04'
323+
```
324+
303325
## Message envelope
304326

305327
Dapr pub/sub adheres to [version 1.0 of CloudEvents](https://github.com/cloudevents/spec/blob/v1.0/spec.md).

0 commit comments

Comments
 (0)