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

#259: Added function to allow processing messages at least once #692

Open
wants to merge 4 commits into
base: series/2.x
Choose a base branch
from

Conversation

V-Lamp
Copy link

@V-Lamp V-Lamp commented May 23, 2023

No description provided.

@V-Lamp V-Lamp requested a review from ghostdogpr as a code owner May 23, 2023 21:19
@CLAassistant
Copy link

CLAassistant commented May 23, 2023

CLA assistant check
All committers have signed the CLA.

@ghostdogpr
Copy link
Member

Is it not possible to test it with elasticmq?

Also, the CI is failing, please check linting and compile errors 🙏

@V-Lamp
Copy link
Author

V-Lamp commented May 24, 2023

Tests with localstack pass in a few seconds and is the de facto standard in testing AWS, so happy to provide this instead (lower effort as I have it working) and will benefit other tests in here eventually 🙂

I will add the tests, and that will fix any issues, I just shared the idea to see if it indeed fits the needs of the use case before I progress further

@ghostdogpr
Copy link
Member

ghostdogpr commented May 24, 2023

I think it would be better for maintainability if all tests used the same backend (whether it's localstack or elasticmq) 😄

Regarding the original idea, I haven't used SQS since 2019 so I don't have much opinions on this anymore, I suggest you ask opinion on the zio Discord, there is a channel for zio-sqs and you might find other users there 👍

@V-Lamp
Copy link
Author

V-Lamp commented May 24, 2023

I have also left a comment in testcontainers-for-zio on this btw: scottweaver/testcontainers-for-zio#41 (comment)

I see what you mean, I would expect it to be easy to transition tests to localstack given that ultimately all that is needed is a Layer providing a zio.aws.sqs.Sqs

@V-Lamp V-Lamp force-pushed the #259-at-least-once branch from e2fe594 to cca8375 Compare May 29, 2023 23:08

object MockSqsServerAndClient {

lazy val layer: ZLayer[Any, Throwable, Sqs] =
Copy link
Author

@V-Lamp V-Lamp May 30, 2023

Choose a reason for hiding this comment

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

I wanted to suggest this approach, where a new mock server is created, with a random port to allow for parallel testing.
The aws config and sqs client are made all together, so that tests just need this single layer and no setup within the tests themselves.

@V-Lamp V-Lamp force-pushed the #259-at-least-once branch from c27a89b to aa32ccc Compare May 30, 2023 18:03
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.

3 participants