Skip to content

[Notifier] Add Amazon SNS bridge #39141

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

Merged
merged 1 commit into from
Jul 25, 2021
Merged

[Notifier] Add Amazon SNS bridge #39141

merged 1 commit into from
Jul 25, 2021

Conversation

adrien-chinour
Copy link
Contributor

@adrien-chinour adrien-chinour commented Nov 22, 2020

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR symfony/symfony-docs#15486
Recipe PR symfony/recipes#847

Hi,

This PR add a bridge on Notifier component for Amazon SNS.

This bridge use async-aws/sns and only work on actual dev-master version of asyc-aws/core.

I'm working on recipe and doc PR.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@jderusse jderusse modified the milestones: 5.1, 5.x Dec 4, 2020
@OskarStark
Copy link
Contributor

Please create Doc PR, thanks

@OskarStark OskarStark requested review from jderusse and removed request for jderusse July 2, 2021 08:45
@OskarStark OskarStark requested a review from Nyholm July 2, 2021 08:45
$response = $this->snsClient->publish($options);

$message = new SentMessage($message, (string) $this);
$message->setMessageId($response->getMessageId());
Copy link
Member

@jderusse jderusse Jul 2, 2021

Choose a reason for hiding this comment

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

I would wrap this in a try/catch block to convert AsyncAws exceptions into TransportException

@fabpot
Copy link
Member

fabpot commented Jul 4, 2021

@adrien-chinour Are you still interested in finishing this implementation?

@adrien-chinour
Copy link
Contributor Author

@adrien-chinour Are you still interested in finishing this implementation?

Yes, I will work on it.

@OskarStark OskarStark requested a review from jderusse July 13, 2021 19:14
"require": {
"php": ">=7.2.5",
"symfony/http-client": "^4.4|^5.2",
"symfony/notifier": "^5.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"symfony/notifier": "^5.3",
"symfony/notifier": "^5.4",

@OskarStark
Copy link
Contributor

Please add the bridge to the UnsupportedSchemeExceptionTest. Thanks

public function toArray(): array
{
$options = $this->options;
unset($options['recipient_id']);
Copy link
Member

Choose a reason for hiding this comment

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

Why storing the recipient in the option property if we don't use it not a standard option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jderusse Yes, I change it to a class property and a required parameter on constructor.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Thank you.

I just had some small comments.

@OskarStark
Copy link
Contributor

Final review @Nyholm ?

@fabpot
Copy link
Member

fabpot commented Jul 25, 2021

Thank you @adrien-chinour.

@fabpot fabpot merged commit ccd3a15 into symfony:5.4 Jul 25, 2021
OskarStark added a commit to symfony/symfony-docs that referenced this pull request Jul 25, 2021
This PR was merged into the 5.4 branch.

Discussion
----------

 [Notifier] Add AmazonSns Bridge

AmazonSns Bridge :  [symfony/symfony #39141](symfony/symfony#39141)

Commits
-------

6ab1a8d  [Notifier] Add AmazonSns Bridge
This was referenced Nov 5, 2021
@jorge-ruukfy

This comment was marked as off-topic.

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.

8 participants