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

CMR-10140-1: Adding subscribing to the local and AWS topics and publishing messages. #2185

Merged
merged 5 commits into from
Nov 1, 2024

Conversation

eereiter
Copy link
Contributor

Overview

What is the feature/fix?

Adding the capability to subscribe/unsubscribe to topics either AWS or local
Adding the capability to publish notification messages when it meets subscription criteria

What is the Solution?

Added the capability to subscribe/unsubscribe an AWS queue to either an AWS or local topic.
Added the capability to metadata_db to send notification messages if the concepts meet the subscription criteria.

What areas of the application does this impact?

Ingest Subscriptions and Metadata_DB.

Checklist

  • I have updated/added unit and int tests that prove my fix is effective or that my feature works
  • New and existing unit and int tests pass locally and remotely
  • clj-kondo has been run locally and all errors corrected
  • I have removed unnecessary/dead code and imports in files I have changed
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have cleaned up integration tests by doing one or more of the following:
    • migrated any are2 tests to are3 in files I have changed
    • de-duped, consolidated, removed dead int tests
    • transformed applicable int tests into unit tests
    • refactored to reduce number of system state resets by updating fixtures (use-fixtures :each (ingest/reset-fixture {})) to be :once instead of :each

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 48.06202% with 134 lines in your changes missing coverage. Please review.

Project coverage is 58.21%. Comparing base (170ed1b) to head (c3f52dc).

Files with missing lines Patch % Lines
...ueue-lib/src/cmr/message_queue/topic/aws_topic.clj 8.33% 33 Missing ⚠️
...ue-lib/src/cmr/message_queue/topic/local_topic.clj 29.72% 26 Missing ⚠️
...p/src/cmr/metadata_db/services/concept_service.clj 0.00% 21 Missing ⚠️
...src/cmr/metadata_db/services/sub_notifications.clj 12.50% 14 Missing ⚠️
.../cmr/metadata_db/data/oracle/sub_notifications.clj 9.09% 10 Missing ⚠️
...a-db-app/src/cmr/metadata_db/api/subscriptions.clj 0.00% 6 Missing ⚠️
...p/src/cmr/ingest/services/subscriptions_helper.clj 16.66% 5 Missing ⚠️
...rations/091_update_cmr_sub_notifications_table.clj 37.50% 5 Missing ⚠️
...app/src/cmr/metadata_db/services/subscriptions.clj 94.73% 0 Missing and 5 partials ⚠️
...ueue-lib/src/cmr/message_queue/queue/aws_queue.clj 25.00% 3 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2185      +/-   ##
==========================================
- Coverage   58.23%   58.21%   -0.03%     
==========================================
  Files        1054     1055       +1     
  Lines       70803    70980     +177     
  Branches     2021     2022       +1     
==========================================
+ Hits        41234    41321      +87     
- Misses      27688    27771      +83     
- Partials     1881     1888       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

;; up the database slowing down all the tests.
(setup-infrastructure this)
(let [metadata (:metadata subscription)
sqs-client (queue/create-sqs-client (config/sqs-server-url))
Copy link
Contributor

Choose a reason for hiding this comment

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

Does an SQS client need to be made for each subscription? Is it like a different interface to the SQS service for each subscription?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I never figured out where the underlying http connection (assuming its http) lived in the AWS libraries. I thought that it would live in the client, so I wanted to limit those and keep them open for quicker communication, but if that is not the case, then we don't need it in the subscription. It is possible that a queue could live in a different place from other queues, but when the subscription is set up all of the clients are set to use the local queue manager.

@eereiter eereiter merged commit e7b2c99 into master Nov 1, 2024
6 checks passed
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.

4 participants