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

Implement AWS JSON protocol 1.0 #815

Merged
merged 29 commits into from
Jun 5, 2023
Merged

Implement AWS JSON protocol 1.0 #815

merged 29 commits into from
Jun 5, 2023

Conversation

katlasik
Copy link
Contributor

@katlasik katlasik commented May 15, 2023

Implement AMZ Json Protocol 1.0.

  • Detect AMZ Json Protocol with content type header and parse the request
  • Respond with correct error format
    - [ ] (optional) Customize serialization (use camelCase in case classes and respond with PascalCase)
  • Support create queue
  • Support list queues
  • Support send message (need more info regarding MD5OfMessageSystemAttributes)
  • Support send message batch
  • Support receive message
  • Support delete message
  • Support delete message batch
  • Support get queue URL
  • Support purge queue
  • Support change message visibility
  • Support change message visibility batch
  • Support delete queue
  • Support get queue attributes
  • Support set queue attributes
  • Support add permission
  • Support tag queue
  • Support untag queue
  • Support list tags of queue
  • Check if Redrive policy is working (it needs set queue attributes)
    - [ ] Add ListDeadLetterSourceQueues Action https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ListDeadLetterSourceQueues.html
    - [ ] Add RemovePermission Action https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_RemovePermission.html
  • Unify how message attributes are parsed and validated

@katlasik katlasik force-pushed the issue-812-wip branch 5 times, most recently from 7a25ce4 to 87cf644 Compare May 15, 2023 07:21
@katlasik katlasik force-pushed the issue-812-wip branch 6 times, most recently from 96c5619 to 2f872a4 Compare May 26, 2023 11:31
@micossow micossow self-requested a review May 27, 2023 07:43
@flsh86
Copy link

flsh86 commented May 29, 2023

Refactoring with AkkaSupport trait

  • Respond with correct error format
  • Support create queue
  • Support list queues
  • Support send message (need more info regarding MD5OfMessageSystemAttributes)
  • Support send message batch
  • Support receive message (We leave as it is for now, too trublesome)
  • Support delete message
  • Support delete message batch
  • Support get queue URL
  • Support purge queue
  • Support change message visibility
  • Support change message visibility batch
  • Support delete queue
  • Support get queue attributes
  • Support set queue attributes
  • Support add permission
  • Support tag queue
  • Support untag queue
  • Support list tags of queue
  • Check if Redrive policy is working (it needs set queue attributes)

@flsh86 flsh86 requested a review from adamw May 29, 2023 12:13
extractRequest { request =>
entityOrEmpty { fd =>
body((fd.fields.toMap ++ queryParameters ++ extractAwsXRayTracingHeader(request)).filter(_._1 != ""))
private def extractQueueNameAndUrlFromRequest(body: Map[String, String] => Route): Route = {
Copy link
Member

Choose a reason for hiding this comment

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

[minor] this looks like a Directive ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean I should move it somewhere?

Copy link
Member

Choose a reason for hiding this comment

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

no, the method should be a directive. Sth like extractQueueNameAndUrlFromRequest(Map): Directive0, no?

@adamw
Copy link
Member

adamw commented May 29, 2023

I left some comments, looks good overall :)

What about testing? Will it be possible to test both the XML and JSON interfaces?

And also ... @micossow maybe you could take a look as well? You're probably most up-to-date with EMQ :)

@flsh86 flsh86 requested a review from adamw May 30, 2023 07:05
@micossow
Copy link
Contributor

closes #812

Copy link
Contributor

@micossow micossow left a comment

Choose a reason for hiding this comment

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

Great job 👏

* Added integration tests for CLI

* Added integration tests for CLI

* send single message tests

* interpolation in strings

* Add test for tagging, adding permissions and for invalid input

* Added test for purge queue

* delete queue wip

* receive messages test

* send message batch tests

* delete message test

* Add tests for visibility timeout

* delete message batch wip

* Tests for set and get attribute names

* Add case keyword for inside blocks

* Skip some tests for 2.12

---------

Co-authored-by: Adam Fish Rybicki <[email protected]>
@micossow micossow self-requested a review June 2, 2023 12:08
@katlasik katlasik marked this pull request as ready for review June 2, 2023 12:19
Copy link
Member

@adamw adamw left a comment

Choose a reason for hiding this comment

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

Great work :)

@micossow micossow merged commit d31bdf2 into master Jun 5, 2023
@micossow micossow deleted the issue-812-wip branch June 5, 2023 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants