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

[#ICC-159] Migrate pushNotification.notifyMessage from durable function to queue #57

Conversation

fabriziopapi
Copy link
Contributor

@fabriziopapi fabriziopapi commented Apr 28, 2022

Re-implement the NotifyMessage orchestrator/activity (io-functions-pushnotif) without the Durable Function.
The NotifyMessage operation will be implemented used a storage queue: the retry mechanism will be provided by the azure function trigger.

List of Changes

Add a notify message implementation based on a storage queue
Replace the notifications handler to use the queue-based notify message implementation
Add Feature Flag to route to notify via queue implementation

Motivation and Context

The DF-based notify message performance are not enough reliable.

How Has This Been Tested?

unit test

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@fabriziopapi fabriziopapi requested a review from a team as a code owner April 28, 2022 13:49
@pagopa-github-bot
Copy link
Contributor

pagopa-github-bot commented Apr 28, 2022

Warnings
⚠️ This PR changes a total of 655 LOCs, that is more than a reasonable size of 250. Consider splitting the pull request into smaller ones.
⚠️ Please include a Pivotal story at the beginning of the PR title (see below).

Example of PR titles that include pivotal stories:

  • single story: [#123456] my PR title
  • multiple stories: [#123456,#123457,#123458] my PR title

Generated by 🚫 dangerJS against 217ce15

@gunzip
Copy link

gunzip commented Apr 28, 2022

Hi @fabriziopapi, may you share some insight about the statement "The DF-based notify message performance are not enough reliable"? We are going to take some choices for another project...

@fabriziopapi
Copy link
Contributor Author

HandleNHNotifyMessageCallActivityQueue/index.ts Outdated Show resolved Hide resolved
HandleNHNotificationCall/handler.ts Outdated Show resolved Hide resolved
HandleNHNotifyMessageCallActivityQueue/handle.ts Outdated Show resolved Hide resolved
T.sequenceArray,
// eslint-disable-next-line functional/immutable-data
T.map(notifyMessages => (context.bindings.notifyMessages = notifyMessages)),
T.map(() => "-1") // There is no orchestrator_id to return
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not refactoring also this return? We are trying to get rid of the orchestrator, can't we refactor the caller to get another type of return?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For queue implementation there is nothing usefull to return: we'll switch it to void at the end of refactor.

HandleNHNotificationCall/handler.ts Show resolved Hide resolved
HandleNHNotifyMessageCallActivityQueue/function.json Outdated Show resolved Hide resolved
HandleNHNotifyMessageCallActivityQueue/index.ts Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@fabriziopapi fabriziopapi changed the title [#IC-448] Migrate pushNotification.notifyMessage from durable function to queue [#ICC-159] Migrate pushNotification.notifyMessage from durable function to queue Aug 2, 2022
@fabriziopapi fabriziopapi requested review from AleDore and Garma00 August 2, 2022 09:59
utils/errors.ts Show resolved Hide resolved
utils/config.ts Show resolved Hide resolved
HandleNHNotifyMessageCallActivityQueue/function.json Outdated Show resolved Hide resolved
HandleNHNotificationCall/function.json Show resolved Hide resolved
@fabriziopapi fabriziopapi requested a review from gquadrati August 5, 2022 10:04
utils/config.ts Show resolved Hide resolved
utils/config.ts Show resolved Hide resolved
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@fabriziopapi fabriziopapi requested a review from gquadrati August 9, 2022 15:37
@BurnedMarshal BurnedMarshal merged commit 28fe79f into master Aug 10, 2022
@BurnedMarshal BurnedMarshal deleted the IC-448--migrate-pushnotification-notifymessage-from-durable-function-to-queue branch August 10, 2022 09:34
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.

6 participants