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

Update integration lib packages & cache reset api #597

Merged
merged 4 commits into from
Oct 16, 2023

Conversation

HansDahle
Copy link
Collaborator

  • New feature
  • Bug fix
  • High impact

Description of work:
Was only going to add a simple endpoint to trigger cache reset across deployed instances.
Utilizing distributed mediatr lib to coordinate across instances.

This caused a larger nuget upgrade scenario, so the main workload here is related to the nuget upgrade.
This also solves the discovery service issue, which promotes integration lib upgrade.

MediatR lib needed to be upgraded which had breaking changes, deprecated the AsyncRequestHandler abstract type, requiring switch to IRequestHandler.
This change also impacted how requests without responses were handled. Behaviours needed updates as well as generic methods which cause ambigous signature issues (DispatchCommand).

Testing:

  • Can be tested
  • Automatic tests created / updated
  • Local tests are passing

Needed to update fixtures due to changes in MediatR setup logic and introduction of new background services and integration which needed new mocks. Distributed mediatr have service bus integration which requires connection string. This is mocked with services doing nothing (if we need to verify distributed message handling a new mock will need to be created).

Checklist:

  • Considered automated tests
  • Considered updating specification / documentation
  • Considered work items
  • Considered security
  • Performed developer testing
  • Checklist finalized / ready for review

Should verify cache reset endpoint, to verify that distributed infra is set up correctly.

@HansDahle HansDahle marked this pull request as ready for review October 16, 2023 09:13
@HansDahle
Copy link
Collaborator Author

Verified cache reset endpoint.

POST https://resources-api-pr-597.fusion-dev.net/admin/cache/reset-internal-cache
{
    "message": "Cache reset has been queued for all instances."
}
❯ fdev sb listen sb-fap-resources-pr -t dist-notifications
Found connection string to sb-fap-resources-pr
Created subscription fdev-04a14e19-6184-4c44-8ddb-f552f888c2d8 on topic dist-notifications
Registered receiver on topic dist-notifications
Listening...
Press enter to exit
---- New message @ 16/10/2023 12:11:19
-- Message Id: 05e96bd9983042d3be1ba526091a129a
-- Content-Type: application/json
-- ApplicationProperty: crlType=Fusion.Resources.Api.DistributedEvents.ResetCacheNotification
-- ApplicationProperty: sourceId=6282d13f-a5b9-4c88-ad03-d8a0e30e5aea
-- ApplicationProperty: scope=Domain
-- ApplicationProperty: sourceService=Fusion.Resources.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
-- ApplicationProperty: Diagnostic-Id=00-92c58f8dcb7bb87ff13823f25edef648-03429d086f5a9aef-00
-- Payload:
{
  "Context": {
    "NotificationId": "c163bfc4-f192-4df7-aa6f-65966b071eeb",
    "SourceId": "6282d13f-a5b9-4c88-ad03-d8a0e30e5aea",
    "IsLocal": true,
    "Scope": 0
  }
}

@HansDahle
Copy link
Collaborator Author

Verified pr function app is triggering cache reset endpoint. Updated function app pr deployment pipeline so it is targeting the api correctly.

@HansDahle HansDahle merged commit 8c95504 into master Oct 16, 2023
8 checks passed
@HansDahle HansDahle deleted the fix/clear-people-cache branch October 16, 2023 11:09
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.

2 participants