-
Notifications
You must be signed in to change notification settings - Fork 162
Closed
Labels
area: examplesarea: specChanges in the SpecificationChanges in the Specificationchange: documentationImprovements or additions to documentation. It won't impact a version change.Improvements or additions to documentation. It won't impact a version change.change: featureNew feature or request. Impacts in a minor version changeNew feature or request. Impacts in a minor version changetype: feature
Milestone
Description
What would you like to be added?
Right now the DSL reference shows this example:
document:
dsl: '1.0.0-alpha5'
namespace: test
name: asyncapi-example
version: '0.1.0'
do:
- subscribeToChatInboxForAmount:
call: asyncapi
with:
document:
endpoint: https://fake.com/docs/asyncapi.json
operation: chat-inbox
protocol: http
subscription:
filter: ${ .roomId == $workflow.input.chat.roomId }
consume:
amount: 5
for:
seconds: 10
Assuming 3 messages are sent to this chat in the following 10 seconds ... what would be the output of this task?
Proposal(s):
I propose that the output of the task should be an array of messages received.
[{"roomId": "1", "text": "Hi"}, {"roomId": "1", "text": "Hello"}, {"roomId": "1", "text": "Bye"}]
But this restricts us to only have "buffered" consumption. It would be beneficial in my opinion to have proper streaming consumption.
Maybe something like a foreach
(name is WIP) property that specifies a list of tasks to perform per message?
document:
dsl: '1.0.0-alpha5'
namespace: test
name: asyncapi-example
version: '0.1.0'
do:
- subscribeToChatInboxForAmount:
call: asyncapi
with:
document:
endpoint: https://fake.com/docs/asyncapi.json
operation: chat-inbox
protocol: http
subscription:
filter: ${ .roomId == $workflow.input.chat.roomId }
consume:
until: ${ true } # forever 😈
foreach:
- emitEvent:
emit: {}
Alternative(s):
No response
Additional info:
No response
Community Notes
- Please vote by adding a 👍 reaction to the feature to help us prioritize.
- If you are interested to work on this feature, please leave a comment.
cdavernas, ricardozanini and JBBianchi
Metadata
Metadata
Assignees
Labels
area: examplesarea: specChanges in the SpecificationChanges in the Specificationchange: documentationImprovements or additions to documentation. It won't impact a version change.Improvements or additions to documentation. It won't impact a version change.change: featureNew feature or request. Impacts in a minor version changeNew feature or request. Impacts in a minor version changetype: feature
Type
Projects
Status
Done