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

CNS-340 - add ability to publish to specific subject hierarchies #112

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

aaslamin
Copy link
Contributor

@aaslamin aaslamin commented Oct 23, 2020

Context

This PR adds an optional ability to publish to specific subject hierarchies of the configured topic of the push server via a new functional option OptPushServerEnableSubjectHierarchies.

The goal is to provide subscribers the ability to receive only events they care about instead of having them be required to add logic to ignore events they are not interested in.

For example:

If the push server topic has been set to global-events and the server is about to push a "create" event w/ an identity value of "apples", enabling this option, would cause the push server to target a new publication to the subject global-events.apples.create, INSTEAD OF global-events.

See https://docs.nats.io/nats-concepts/subjects for more details.

Will be used to solve

…he configured topic of the push server via a new functional option
@aaslamin aaslamin changed the title CNS-340 - add ability to publish to specific subject hierarchies of t… CNS-340 - add ability to publish to specific subject hierarchies Oct 23, 2020
//
// see: https://docs.nats.io/nats-concepts/subjects#wildcards for more details.
//
// TODO: in the future, support to subscribing to specific subjects and/or wildcards may be added.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

👀 @primalmotion 😉

@codecov
Copy link

codecov bot commented Oct 23, 2020

Codecov Report

Merging #112 into master will increase coverage by 0.02%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
+ Coverage   90.51%   90.54%   +0.02%     
==========================================
  Files          45       45              
  Lines        3185     3195      +10     
==========================================
+ Hits         2883     2893      +10     
+ Misses        234      233       -1     
- Partials       68       69       +1     
Impacted Files Coverage Δ
bahamut.go 62.96% <0.00%> (-1.19%) ⬇️
options.go 100.00% <100.00%> (ø)
websocket_server.go 80.75% <100.00%> (+0.55%) ⬆️
gateway/upstreamer/push/upstreamer.go 92.74% <0.00%> (+0.80%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f938992...a8fe1b5. Read the comment docs.

@aaslamin aaslamin marked this pull request as ready for review October 26, 2020 18:54
@aaslamin
Copy link
Contributor Author

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "pubsub-subject-hierarchy",
    "component": "bahamut",
    "pr-id": "112",
    "commit-sha": "a8fe1b58b52314917890c6031e07b5c47c2eab8b",
    "pipeline": "master"
  },
  {
    "project": "pubsub-subject-hierarchy",
    "component": "backend",
    "pr-id": "897",
    "commit-sha": "1c3c19370ac82c6c483003fd0ed716d5899fb625",
    "pipeline": "master"
  }
]

@aaslamin
Copy link
Contributor Author

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "pubsub-subject-hierarchy",
    "component": "bahamut",
    "pr-id": "112",
    "commit-sha": "a8fe1b58b52314917890c6031e07b5c47c2eab8b",
    "pipeline": "master"
  },
  {
    "project": "pubsub-subject-hierarchy",
    "component": "backend",
    "pr-id": "897",
    "commit-sha": "c1f36a6347dbb1c8e42a9650594b6f397e99976b",
    "pipeline": "master"
  }
]

@aaslamin
Copy link
Contributor Author

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "pubsub-subject-hierarchy",
    "component": "backend",
    "pr-id": "897",
    "commit-sha": "c1f36a6347dbb1c8e42a9650594b6f397e99976b",
    "pipeline": "master"
  },
  {
    "project": "pubsub-subject-hierarchy",
    "component": "bahamut",
    "pr-id": "112",
    "commit-sha": "a8fe1b58b52314917890c6031e07b5c47c2eab8b",
    "pipeline": "master"
  }
]

@aaslamin
Copy link
Contributor Author

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "pubsub-subject-hierarchy",
    "component": "bahamut",
    "pr-id": "112",
    "commit-sha": "a8fe1b58b52314917890c6031e07b5c47c2eab8b",
    "pipeline": "master"
  },
  {
    "project": "pubsub-subject-hierarchy",
    "component": "backend",
    "pr-id": "897",
    "commit-sha": "daf4b2eb60450bc35c0c52c58282599eabdb2c7b",
    "pipeline": "master"
  }
]

1 similar comment
@aaslamin
Copy link
Contributor Author

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "pubsub-subject-hierarchy",
    "component": "bahamut",
    "pr-id": "112",
    "commit-sha": "a8fe1b58b52314917890c6031e07b5c47c2eab8b",
    "pipeline": "master"
  },
  {
    "project": "pubsub-subject-hierarchy",
    "component": "backend",
    "pr-id": "897",
    "commit-sha": "daf4b2eb60450bc35c0c52c58282599eabdb2c7b",
    "pipeline": "master"
  }
]

@primalmotion primalmotion merged commit e0600e4 into master Oct 26, 2020
@primalmotion primalmotion deleted the cns-340 branch October 26, 2020 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants