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

docs: proposed set of bindings for AWS - SNS and SQS #84

Merged
merged 92 commits into from
Jul 19, 2023

Conversation

iancooper
Copy link
Collaborator

@iancooper iancooper commented Sep 16, 2021

Description

  • This is a proposed set of bindings for SNS and SQS
  • They are complete enough to allow using AWS APIs to create infrastructure from the information here; we don't expect all properties to be set for most use cases
  • Main points of interest are how we map between SNS and SQS using the Identifier and a Name value, as we need to get one to refer to the other in cases where we will create both.

This is currently a draft, once we are through feedback, I need to add the JSON schema that matches what we agree too, and then I'll convert to ready

@iancooper iancooper marked this pull request as draft September 16, 2021 13:51
@iancooper iancooper changed the title docs: A proposed set of bindings for AWS - SNS and SQS docs: proposed set of bindings for AWS - SNS and SQS Sep 16, 2021
@iancooper
Copy link
Collaborator Author

@derberg and @fmvilas If no one has comments, I'll add the JSON and we can discuss how to progress this towards getting merged?

@derberg
Copy link
Member

derberg commented Nov 2, 2021

@iancooper tbh there are no comments as it is in Draft mode. I personally never look at Draft PRs as they indicate that it is still in progress not ready for review

@iancooper iancooper marked this pull request as ready for review February 9, 2022 12:35
@jorgebo10
Copy link

jorgebo10 commented May 27, 2022

Hi, any progress done on this? Seems an interesting approach to me.

@derberg
Copy link
Member

derberg commented Jun 7, 2022

@iancooper can you please remove .DS_Store from PR? also Conventions.md is probably from another PR. Also since some time, bindings require JSON Schemas, please add them

@jorgebo10 if you know these protocols, please do review proposed bindings from @iancooper as I'm definitely not an expert, and we do not know many in the community

@boyney123 do you know anyone who could help with review

@iancooper as currently these bindings are empty, will you also maintain these definitions long term? do you want to become the maintainer of this repo?

I'm really sorry for keeping it waiting, for just such a short comment for 4 months 😞

@iancooper
Copy link
Collaborator Author

@derberg

an you please remove .DS_Store from PR? also Conventions.md is probably from another PR. Also since some time, bindings require JSON Schemas, please add them

Will do, I had left the schema to get discussion of the proposal, before doing that work. It was originally why I put it into draft. It might be worth thinking about process here.

as currently these bindings are empty, will you also maintain these definitions long term? do you want to become the maintainer of this repo?

Love to. I have a team at Just Eat Takeaway who I can rope in to help make sure we are on top of PRs etc. It could be a lot for one person (and we get the bus problem).

I'm really sorry for keeping it waiting, for just such a short comment for 4 months
All good, I owe you picking up on Spec 3.0 and coming to some more meetings. We do what we can.

@derberg
Copy link
Member

derberg commented Jun 8, 2022

Will do, I had left the schema to get discussion of the proposal, before doing that work. It was originally why I put it into draft. It might be worth thinking about process here.

ok, that makes sense, for initial review markdown is critical

Love to. I have a team at Just Eat Takeaway who I can rope in to help make sure we are on top of PRs etc. It could be a lot for one person (and we get the bus problem).

Perfect ❤️


if you know other folks outside your company and use cases using SNS/SQS that you can reach for giving feedback in this PR, please contact them, also on social media. I will also ping community on AsyncAPI social accounts

Copy link

@zekth zekth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple nits here and there at the first pass.
As previously mentionned the .DS_Store file needs to be removed and the json schemas generated.

I also mentionned this PR to @Kong folks as we are inclined to incorporate those specs in our platforms.

sns/README.md Outdated
|Field Name | Type | Description|
|---|:---:|---|
| <a name="channelBindingPolicyStatementObjectEffect"></a>`effect` | string |**Required.** Either "Allow" or "Deny"|
| <a name="channelBindingPolicyStatementObjectPrincipal"></a>`principal` | string or array of string |**Required.** The AWS account or IAM user to whom this statement applies|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be ARN or Aws Account ID?
eg:

"Principal": { "AWS": "arn:aws:iam::123456789012:root" }
"Principal": { "AWS": "123456789012" }

ref: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html

sqs/README.md Outdated
|---|:---:|---|
|<a name="queueObjectRef"></a>$ref | `string` | Allows for an external definition of a queue. The referenced structure MUST be in the format of a [Queue](#queue). If there are conflicts between the referenced definition and this Queue's definition, the behavior is *undefined*.|
| <a name="queueObjectName"></a>`name` | string | **Required.** The name of the queue. When an [SNS Operation Binding Object]() references an SQS queue by name, the identifier should be the one in this field.|
| <a name="queueObjectType"></a>`type` | string one of: fifo, standard | **Required.** Is this a FIFO queue or a standard queue? |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to use a string field in here instead of a Boolean for FifoQueue ? Aws defines it as one: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sqs-queue.html

sqs/README.md Outdated
|Field Name | Type | Description|
|---|:---:|---|
| <a name="channelBindingPolicyStatementObjectEffect"></a>`effect` | string |**Required.** Either "Allow" or "Deny"|
| <a name="channelBindingPolicyStatementObjectPrincipal"></a>`principal` | string or array of string |**Required.** The AWS account or IAM user to whom this statement applies|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark as SNS.

sns/README.md Outdated
| <a name="operationBindingObjectEndpoint"></a>`endpoint` |[identifier](#identifier)| **Required.** Where are messages being delivered to?|
| <a name="operationBindingObjectFilerPolicy"></a>`filterPolicy` | [filterPolicy](#filter-policy) | **Optional.** Only receive a subset of messages from the channel, determined by this policy.|
| <a name="operationBindingObjectRawMessageDelivery"></a>`rawMessageDelivery` | boolean | **Required.** If *true* AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If *false* the SNS attributes are included in the body. |
| <a name="operationBindingObjectRedrivePolicy"></a>`reDrivePolicy` | [redrivePolicy](#redrive-policy) | **Optional.** Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue. |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| <a name="operationBindingObjectRedrivePolicy"></a>`reDrivePolicy` | [redrivePolicy](#redrive-policy) | **Optional.** Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue. |
| <a name="operationBindingObjectRedrivePolicy"></a>`redrivePolicy` | [redrivePolicy](#redrive-policy) | **Optional.** Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue. |

There is the casing issue over the spec. I think redrivePolicy is the good format.

@Kamran64
Copy link

Hey, I see there's not been traction in this PR in a while. When can we expect these bindings (particularly SNS as that's what I need 😁) to be included in the Async spec/what else needs to be done?

@iancooper
Copy link
Collaborator Author

iancooper commented Nov 18, 2022 via email

@Kamran64
Copy link

@iancooper - Thanks for the update, who do you need reviews from? This Async team directly or people in the community who have worked with SNS before? If the latter I can see if I can loop some people in to share their thoughts.

Copy link

@jeff9finger jeff9finger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this design allow for a one-to-many relationship between SNS and SQS?

Something like: SNS message --> [SQS 0, SQS 1, SQS 2, ..., SQS n]

And also associated dead letter queues where needed for each SQS queue?

It is not clear to me from the examples that this is a possibility.

Thanks

### Fields
|Field Name | Type | Description|
|---|:---:|---|
| <a name="channelBindingObjectQueue"></a>`queue` | [Queue](#queue)| **Required.** A definition of the queue that will be used as the channel. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should'n the name here be queues? This is an array, so why is it singular? Was that a typo?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeff9finger I don't think the type is an array. It's of type Queue which I think is consistent with source bindings living at this level of the specification.

Something like: SNS message --> [SQS 0, SQS 1, SQS 2, ..., SQS n]

The queues property does exist on the proposed binding but its part of the binding that sits at the publish level for facilitating things like an sns configured at the channel level and then multiple consumer queues receiving messages. Example from the proposal below as you cannot link to specific MD lines.

sqs:
      queues:
      - name: user-signedup-queue
        type: standard
        receiveMessageWaitTime: 4
        policy:
          statements: 
          - effect : Allow
            principal: *
            action: Sqs:SendMessage
          - effect : Allow
            principal: *
            action: Sqs:ReceiveMessage 

| <a name="queueObjectPolicy"></a>`policy` |[Policy](#policy) | **Optional.** The security policy for the SQS Queue |
| <a name="queueObjectTags"></a>`tags` |Object | **Optional.** Key-value pairs that represent AWS tags on the queue. |

#### Identifier

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can an Identifier contain more than one of these? Or does that table have more of a oneOf semantic?

user-signedup:
bindings:
sqs:
queue:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From comment above, shouldn't this be queues?

deadLetterQueue:
name: user-signedup-queue-dlq
sqs:
queues:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that this item uses queues. This seems correct, but queue is used elsewhere, so am a little confused.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope my comment above addressed this. At the publish level you can configure multiple queues that receive data, but at the channel level you should only configure a single queue because this is the primary logical pipe through which data flows. For the example a point to point SQS model (in the single channel level queue example) as opposed to SNS -> SQS pub sub model (possible one to many messaging).

sqs/README.md Outdated
#### Redrive Policy
|Field Name | Type | Description|
|---|:---:|---|
| <a name="redrivePolicyObjectDeadLetterQueue"></a>`deadLetterQueue` |[Identifier](#identifier)| **Required.** The SQS queue to use as a dead letter queue (DLQ) |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iancooper why DeadLetterQueue is required? Don't you think that the Redrive policy should be a decision of the application and the spec shouldn't enforce it?

@rngtng
Copy link

rngtng commented Mar 15, 2023

How can I help to get this PR forward? I'm about to spec messages for SNS/SQS and would love to make use of this

@dpwdec
Copy link
Collaborator

dpwdec commented Mar 17, 2023

@rngtng Apart from the question raised by @loe-lobo about changing DLQ to not be required. I think it's good to go. After that is changed we could move towards merging it to allow standardisation in other tooling to be built.

@derberg
Copy link
Member

derberg commented Jun 27, 2023

@dpwdec thanks for all the hard work!!! I see no objection from other participants in this PR to make you a maintainer of these bindings

Just please remove .DS_Store from PR


There is one concern I have, the conventions file, it is not related to these new bindings only but sets a conventions on all the bindings, which should be done in a separate PR imho, to not mix contexts. Conventions are something that need to be respected, thus part of contribution guide and review process. So to make sure that happens, separate discussion and 👍🏼 from other bindings owners is a must imho

@dpwdec
Copy link
Collaborator

dpwdec commented Jul 3, 2023

Hi @derberg! Thanks for taking the time to look through it all :D I've removed .DS_Store now and migrated conventions.md to a separate PR which I will expand for further discussion. So I think we may be good to go?

@JaredAAT
Copy link

Is this likely to get merged soon?

@dpwdec
Copy link
Collaborator

dpwdec commented Jul 12, 2023

@JaredAAT As far as I am aware everything is complete. It's just waiting to be merged.

@derberg
Copy link
Member

derberg commented Jul 13, 2023

@dpwdec sorry for another question but I just want to be 100% sure before we merge

  • @iancooper is the creator of the PR but at some point of time you took over. I tried to follow but could not find a comment when you folks agree on that
  • I'm also asking because at the moment I see that you will be the only maintainer for the binding. We do allow it but it usually happens when we know the contributor form discussions, especially Slack presence and we know that in case of emergency there are some ways to contact in a way different than GitHub, and they can also easily reach us in case help is needed. I hope I explain myself well. So in case of recent addition of jms binding a totally new community member became maintainer because another existing maintainer agreed to join with him

Basically trying to figure what will happen the next day we merge this 😅

@iancooper
Copy link
Collaborator Author

@dpwdec sorry for another question but I just want to be 100% sure before we merge

* @iancooper is the creator of the PR but at some point of time you took over. I tried to follow but could not find a comment when you folks agree on that

Hi @derberg, thanks for asking. I work with @dpwdec. He is part of a team at Just Eat Takeaway I provide advice to, who are implementing AsyncAPI for us. I ran out of time to pursue this PR, so I delegated it to the team instead. I am happy to keep being informed and help out, but the team has more time for the detail here than I do right now.

* I'm also asking because at the moment I see that you will be the only maintainer for the binding. We do allow it but it usually happens when we know the contributor form discussions, especially [Slack](https://asyncapi.com/slack-invite) presence and we know that in case of emergency there are some ways to contact in a way different than GitHub, and they can also easily reach us in case help is needed. 

Happy to keep being a maintainer with @dpwdec to avoid a single-point of failure. We might be able to find some other folks in the team too.

@dpwdec
Copy link
Collaborator

dpwdec commented Jul 14, 2023

@derberg Seconding what's said above, more than happy to provide support for SNS/SQS bindings in tandem with @iancooper or any others who feel they have the expertise or time to provide the support as well. I'm also on the slack now and can provide more contact details to other AsyncAPI maintainers if required. 👍

@derberg
Copy link
Member

derberg commented Jul 17, 2023

@dpwdec sorry if I sounded like you are not welcome or something like that. It’s just that the problem with bindings we have that they are basically “micro specifications for AsyncAPI” so they do not change often, very rare, so there is no proper path for potential maintainer to feel the AsyncAPI community spirit before we invite to the org.

So basically since last few months where AnypointMQ spec maintainers had to change we were afraid we just invite someone who we will not be really able to contact with in case of problems, someone that is not known. I hope you know what I mean. So in JMS we luckily had existing codeowner volunteer to help the other “fresh” maintainer.

Governance of AsyncAPI Initiative works in the way that any maintainer can become a TSC member without any secret invitation to secret club 😄 so good to know that the person we appoint for maintainer role is easy to reach on different channels in case of emergency.

anyway, super happy to see @iancooper already commenting on this. He is a great guy that was very active some time ago so if you folks work together and are both fine to be co-maintainers that is a perfect situation 🍺

@dpwdec please update the CODEOWNERS and add Ian

After we merge this PR, feel free to add your names to https://github.com/asyncapi/community/blob/master/MAINTAINERS.yaml through a PR. Do it if you wish to be more involved in the community and help it to grow.

Also, you might be interested in applying for one of our AsyncAPI events this year. We have London CFP opened https://conference.asyncapi.com/ and I bet SQS/SNS talk would be super interesting

@iancooper
Copy link
Collaborator Author

All good @derberg I was just conscious of becoming a bottleneck, so I involved the team here, and @dpwdec has done a ton of heavy lifting. He is using my fork, so I see the PRs before merging.

@dpwdec
Copy link
Collaborator

dpwdec commented Jul 17, 2023

@derberg No problem at all, I didn't feel it was unwelcoming! As you've said above there are can and will be issues and you need to make sure there are some contingencies in place for when that happens. I'll update CODEOWNERS tomorrow morning and take a look at the conference as well! 🙌

@dpwdec
Copy link
Collaborator

dpwdec commented Jul 19, 2023

@derberg CODEOWNERS has been updated now 😊

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for all the hard work

@iancooper @dpwdec

so this binding will work with AsyncAPI prior 3.0

once this is merged, please look into #182. We need you to inspect if there will be any changes needed to make binding work with 3.0

@derberg
Copy link
Member

derberg commented Jul 19, 2023

@KhudaDad414 you need to approve again as JSON Schemas guardian 😄

Copy link
Member

@KhudaDad414 KhudaDad414 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@KhudaDad414
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit a7f7f64 into asyncapi:master Jul 19, 2023
@KhudaDad414
Copy link
Member

Great effort @iancooper @dpwdec 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.