Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine AsyncAPI call #1045

Closed
cdavernas opened this issue Jan 8, 2025 · 0 comments · Fixed by #1053
Closed

Redefine AsyncAPI call #1045

cdavernas opened this issue Jan 8, 2025 · 0 comments · Fixed by #1053
Assignees
Labels
area: examples area: spec Changes in the Specification change: breaking A breaking change that will impact in a major version change. change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change change: fix Something isn't working. Impacts in a minor version change. type: feature
Milestone

Comments

@cdavernas
Copy link
Member

What would you like to be added?

Redefine AsyncAPI call, which is missing crucial properties to make it work as expected

Proposal(s):

Properties

Name Type Required Description
document externalResource yes The AsyncAPI document that defines the operation to call.
channel string yes The name of the channel on which to perform the operation. The operation to perform is defined by declaring either message, in which case the channel's publish operation will be executed, or subscription, in which case the channel's subscribe operation will be executed.
Used only in case the referenced document uses AsyncAPI v2.6.0.
operation string yes A reference to the AsyncAPI operation to call.
Used only in case the referenced document uses AsyncAPI v3.0.0.
server serverDefinition no An object used to configure to the server to call the specified AsyncAPI operation on.
If not set, default to the first server matching the operation's channel.
protocol string no The protocol to use to select the target server.
Ignored if server has been set.
Supported values are: amqp, amqp1, anypointmq, googlepubsub, http, ibmmq, jms, kafka, mercure, mqtt, mqtt5, nats, pulsar, redis, sns, solace, sqs, stomp and ws
message messageDefinition no An object used to configure the message to publish using the target operation.
Required if subscription has not been set.
subscription subscriptionDefinition no An object used to configure the subscription to messages consumed using the target operation.
Required if message has not been set.
authentication string
authentication
no The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation.

Examples

Publish

call: asyncapi
with:
  document:
    endpoint: https://fake.com/docs/asyncapi.json
  operation: greet
  server:
    name: greetingsServer
    variables:
      environment:  dev
  message:
    payload:
      greetings: Hello, World!
    headers:
      foo: bar
      bar: baz

Subscribe

call: asyncapi
with:
  document:
    endpoint: https://fake.com/docs/asyncapi.json
  operation: chat-inbox
  protocol: http
  subscription:
    correlation: ${ . == $workflow.input.chat.roomId } 
    consume:
      amount: 5
      for:
        seconds: 10
      while: ${ ($context.messages | length) < 5 }
      until: ${ ($context.messages | length) == 5 }

AsyncAPI Server Definition

Name Type Required Description
server.name string yes The name of the server to call the specified AsyncAPI operation on.
server.variables object no The target server's variables, if any.

AsyncAPI Message Definition

Name Type Required Description
message.payload object no The message's payload, if any.
message.headers object no The message's headers, if any.

AsycnAPI Subscription Definition

Name Type Required Description
subscription.correlation string no A runtime expression, if any, used to filter consumed messages based on their correlation id..
subscription.consume subscriptionLifetimeDefinition yes An object used to configure the subscription's lifetime.
subscription.consume.amount integer no The amount of messages to consume.
Required if while and until have not been set.
subscription.consume.for duration no The duration that defines for how long to consume messages.
subscription.consume.while string no A runtime expression, if any, used to determine whether or not to keep consuming messages.
Required if amount and until have not been set.
subscription.consume.until string no A runtime expression, if any, used to determine until when to consume messages.
Required if amount and while have not been set.

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 cdavernas added change: fix Something isn't working. Impacts in a minor version change. change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change area: spec Changes in the Specification change: breaking A breaking change that will impact in a major version change. area: examples type: feature labels Jan 8, 2025
@cdavernas cdavernas added this to the v1.0.0 milestone Jan 8, 2025
@cdavernas cdavernas self-assigned this Jan 8, 2025
@cdavernas cdavernas linked a pull request Jan 8, 2025 that will close this issue
8 tasks
@github-project-automation github-project-automation bot moved this from Backlog to Done in Progress Tracker Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples area: spec Changes in the Specification change: breaking A breaking change that will impact in a major version change. change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change change: fix Something isn't working. Impacts in a minor version change. type: feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant