Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

try to use SES in Soto SDK with Vapor 4 but I have some error #708

Closed
NerisD opened this issue Feb 5, 2024 · 2 comments
Closed

try to use SES in Soto SDK with Vapor 4 but I have some error #708

NerisD opened this issue Feb 5, 2024 · 2 comments

Comments

@NerisD
Copy link

NerisD commented Feb 5, 2024

Describe the bug
I want to use SES Services with Vapor 4 to send an Email with my own route.

I follow step by step the recommendation in Soto Doc to use Vapor 4.

But I got this error :
AsyncHTTPClient/HTTPClient.swift:591: Precondition failed: Provided EventLoop must be part of clients EventLoopGroup.

Some one can give me some explanations or explain how can I implement Soto SES with Vapor.

Thanks :)

@NerisD NerisD changed the title try to use SES in Soto SDK but I have some error try to use SES in Soto SDK with Vapor 4 but I have some error Feb 5, 2024
@adam-fowler
Copy link
Member

Are you creating your AWSClient with httpClientProvider set to .createNew and when calling SES methods setting eventLoop to req.eventLoop? If so you are asking the HTTP client to run on an EventLoop from a different EventLoopGroup.

If you want to use the request event loop you need to use an HTTP client that uses the same EventLoopGroup. Luckily Vapor provides one. I believe you can get it via app.client.shared. You should then create your AWSClient as follows

let awsClient = AWSClient(httpClientProvider: .shared(app.client.shared))

@adam-fowler
Copy link
Member

Converting this to a discussion, as it is not an issue

@soto-project soto-project locked and limited conversation to collaborators Feb 5, 2024
@adam-fowler adam-fowler converted this issue into discussion #709 Feb 5, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants