Skip to content

Commit 818f08c

Browse files
committed
Add a new to property to the emit task, used to configure an additional endpoint to publish the configured event to
Closes #1026 Signed-off-by: Charles d'Avernas <[email protected]>
1 parent df6686a commit 818f08c

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

dsl-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ Allows workflows to publish events to event brokers or messaging systems, facili
508508
| Name | Type | Required | Description |
509509
|:--|:---:|:---:|:---|
510510
| emit.event | [`eventProperties`](#event-properties) | `yes` | Defines the event to emit. |
511+
| emit.to | [`endpoint`](#endpoint) | `no` | Specifies an additional endpoint for emitting the event. While the runtime's default cloud event endpoint remains the primary destination, setting this property ensures that the event is also published to the specified endpoint. Ideally, this property is left unset so that event delivery relies solely on the runtime's configured endpoint, but when provided, the event will be sent to both endpoints concurrently. |
511512

512513
##### Examples
513514

examples/emit-additional-sink.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
document:
2+
dsl: '1.0.0-alpha5'
3+
namespace: test
4+
name: emit
5+
version: '0.1.0'
6+
do:
7+
- emitEvent:
8+
emit:
9+
event:
10+
with:
11+
source: https://petstore.com
12+
type: com.petstore.order.placed.v1
13+
data:
14+
client:
15+
firstName: Cruella
16+
lastName: de Vil
17+
items:
18+
- breed: dalmatian
19+
quantity: 101
20+
to: https://additional-cloud-event-sink.com/pub

schema/workflow.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$id: https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.yaml
1+
$id: https://serverlessworkflow.io/schemas/1.0.0-alpha6/workflow.yaml
22
$schema: https://json-schema.org/draft/2020-12/schema
33
description: Serverless Workflow DSL - Workflow Schema.
44
type: object
@@ -482,6 +482,10 @@ $defs:
482482
description: Defines the properties of event to emit.
483483
required: [ source, type ]
484484
additionalProperties: true
485+
to:
486+
$ref: '#/$defs/endpoint'
487+
title: EmitEndpointDefinition
488+
description: Defines the additional endpoint, if any, to emit the event to.
485489
required: [ event ]
486490
forTask:
487491
type: object

0 commit comments

Comments
 (0)