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

🎉 NATS Plugin 🚧 #666

Merged
merged 38 commits into from
Oct 4, 2024
Merged

🎉 NATS Plugin 🚧 #666

merged 38 commits into from
Oct 4, 2024

Conversation

ff137
Copy link
Collaborator

@ff137 ff137 commented Sep 18, 2024

Copied from redis_events plugin, and replaced redis with nats-py (and json with orjson)

Copied from redis_events plugin, and replaced redis with nats-py (and json with orjson)

Signed-off-by: ff137 <[email protected]>
@ff137 ff137 self-assigned this Sep 18, 2024
@ff137 ff137 added the enhancement New feature or request label Sep 18, 2024
nats_events/README.md Outdated Show resolved Hide resolved
Copy link

@henrymsiska henrymsiska left a comment

Choose a reason for hiding this comment

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

🚀

nats_events/README.md Outdated Show resolved Hide resolved
ff137 and others added 5 commits September 19, 2024 13:34
@ff137 ff137 merged commit ad1ecd1 into main Oct 4, 2024
2 checks passed
@ff137 ff137 deleted the feat/nats_events branch October 4, 2024 12:32
ff137 pushed a commit that referenced this pull request Oct 22, 2024
Bumps [google-api-python-client](https://github.com/googleapis/google-api-python-client) from 2.133.0 to 2.134.0.
- [Release notes](https://github.com/googleapis/google-api-python-client/releases)
- [Commits](googleapis/google-api-python-client@v2.133.0...v2.134.0)

---
updated-dependencies:
- dependency-name: google-api-python-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ff137 added a commit that referenced this pull request Oct 22, 2024
* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* 🚀 take on NATS plugin

Copied from redis_events plugin, and replaced redis with nats-py (and json with orjson)

Signed-off-by: ff137 <[email protected]>

* ✅ basic unit tests for events

Signed-off-by: ff137 <[email protected]>

* 👷 skip nats_events integration testing

Signed-off-by: ff137 <[email protected]>

* ✨ read `NATS_CREDS_FILE` from env vars

Signed-off-by: ff137 <[email protected]>

* Update nats_events/README.md

Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>

* 🎨 rename nats topic to subject

Signed-off-by: ff137 <[email protected]>

* 🎨 replace f-string interpolation in logs

Signed-off-by: ff137 <[email protected]>

* ✨ use JetStream. Define streams on startup

Signed-off-by: ff137 <[email protected]>

* ✨ bind and re-use JetStream context

Signed-off-by: ff137 <[email protected]>

* ✨ handle jetstream publish ack

Signed-off-by: ff137 <[email protected]>

* 🎨 remove use of `cast`

Signed-off-by: ff137 <[email protected]>

* 🎨 more clear setup of jetstream context, instead of just nats

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* 🎨 update NATS subject map to use `.`-pattern

Signed-off-by: ff137 <[email protected]>

* Update nats_events/README.md

Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>

* 🙈 don't ignore vscode settings

Signed-off-by: ff137 <[email protected]>

* 🔧 vscode cspell settings

Signed-off-by: ff137 <[email protected]>

* 🎨

Signed-off-by: ff137 <[email protected]>

* 🚧 add some verbose logging for testing

Signed-off-by: ff137 <[email protected]>

* 🎨 update method for nats connection args

Signed-off-by: ff137 <[email protected]>

* 🚧 debug timeout error for defining stream, change stream name

Signed-off-by: ff137 <[email protected]>

* 🚧 debug on_startup connecting to jetstream

Signed-off-by: ff137 <[email protected]>

* 🚧 test replacing . in name with _

Signed-off-by: ff137 <[email protected]>

* ✨ publish with retry -- correctly handle PubAck

Signed-off-by: ff137 <[email protected]>

* 🎨 log payload and no longer only write `with-state` records

Signed-off-by: ff137 <[email protected]>

* 🎨 fix payload log type

Signed-off-by: ff137 <[email protected]>

* 🎨 log levels

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* ✨ handle OutboundMessage type (make it serialisable)

Signed-off-by: ff137 <[email protected]>

* 🎨 retry should log error instead of raising exception

Signed-off-by: ff137 <[email protected]>

* 🎨 handle optional target types

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* 🎨 add words to cspell list

Signed-off-by: ff137 <[email protected]>

* 🚧 remove define stream

Signed-off-by: ff137 <[email protected]>

* 🎨 define one stream with many subjects

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>
Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: ff137 <[email protected]>
ff137 added a commit that referenced this pull request Oct 22, 2024
* 🎉 NATS Plugin 🚧 (#666)

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* 🚀 take on NATS plugin

Copied from redis_events plugin, and replaced redis with nats-py (and json with orjson)

Signed-off-by: ff137 <[email protected]>

* ✅ basic unit tests for events

Signed-off-by: ff137 <[email protected]>

* 👷 skip nats_events integration testing

Signed-off-by: ff137 <[email protected]>

* ✨ read `NATS_CREDS_FILE` from env vars

Signed-off-by: ff137 <[email protected]>

* Update nats_events/README.md

Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>

* 🎨 rename nats topic to subject

Signed-off-by: ff137 <[email protected]>

* 🎨 replace f-string interpolation in logs

Signed-off-by: ff137 <[email protected]>

* ✨ use JetStream. Define streams on startup

Signed-off-by: ff137 <[email protected]>

* ✨ bind and re-use JetStream context

Signed-off-by: ff137 <[email protected]>

* ✨ handle jetstream publish ack

Signed-off-by: ff137 <[email protected]>

* 🎨 remove use of `cast`

Signed-off-by: ff137 <[email protected]>

* 🎨 more clear setup of jetstream context, instead of just nats

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* 🎨 update NATS subject map to use `.`-pattern

Signed-off-by: ff137 <[email protected]>

* Update nats_events/README.md

Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>

* 🙈 don't ignore vscode settings

Signed-off-by: ff137 <[email protected]>

* 🔧 vscode cspell settings

Signed-off-by: ff137 <[email protected]>

* 🎨

Signed-off-by: ff137 <[email protected]>

* 🚧 add some verbose logging for testing

Signed-off-by: ff137 <[email protected]>

* 🎨 update method for nats connection args

Signed-off-by: ff137 <[email protected]>

* 🚧 debug timeout error for defining stream, change stream name

Signed-off-by: ff137 <[email protected]>

* 🚧 debug on_startup connecting to jetstream

Signed-off-by: ff137 <[email protected]>

* 🚧 test replacing . in name with _

Signed-off-by: ff137 <[email protected]>

* ✨ publish with retry -- correctly handle PubAck

Signed-off-by: ff137 <[email protected]>

* 🎨 log payload and no longer only write `with-state` records

Signed-off-by: ff137 <[email protected]>

* 🎨 fix payload log type

Signed-off-by: ff137 <[email protected]>

* 🎨 log levels

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* ✨ handle OutboundMessage type (make it serialisable)

Signed-off-by: ff137 <[email protected]>

* 🎨 retry should log error instead of raising exception

Signed-off-by: ff137 <[email protected]>

* 🎨 handle optional target types

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* 🎨 add words to cspell list

Signed-off-by: ff137 <[email protected]>

* 🚧 remove define stream

Signed-off-by: ff137 <[email protected]>

* 🎨 define one stream with many subjects

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>
Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: ff137 <[email protected]>

* 🎨 nats_events: update log levels (#733)

* 🎨 Update log levels

Signed-off-by: ff137 <[email protected]>

* ⬆️ Upgrade uvicorn

Signed-off-by: ff137 <[email protected]>

* ⬆️ Upgrade fastapi-slim

Signed-off-by: ff137 <[email protected]>

* ⬆️ Upgrade pytest-asyncio

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* 🐛 trace -> debug

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>

* Skip-nats-outbound-messages (#734)

* ⚡ skip outbound message types, temporarily for performance reasons

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update dependencies

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock file

Signed-off-by: ff137 <[email protected]>

* ⏪ Revert changes to other lock files

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>
Co-authored-by: Henry Msiska <[email protected]>
ff137 added a commit that referenced this pull request Nov 12, 2024
* 🎉 NATS Plugin 🚧 (#666)

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* 🚀 take on NATS plugin

Copied from redis_events plugin, and replaced redis with nats-py (and json with orjson)

Signed-off-by: ff137 <[email protected]>

* ✅ basic unit tests for events

Signed-off-by: ff137 <[email protected]>

* 👷 skip nats_events integration testing

Signed-off-by: ff137 <[email protected]>

* ✨ read `NATS_CREDS_FILE` from env vars

Signed-off-by: ff137 <[email protected]>

* Update nats_events/README.md

Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>

* 🎨 rename nats topic to subject

Signed-off-by: ff137 <[email protected]>

* 🎨 replace f-string interpolation in logs

Signed-off-by: ff137 <[email protected]>

* ✨ use JetStream. Define streams on startup

Signed-off-by: ff137 <[email protected]>

* ✨ bind and re-use JetStream context

Signed-off-by: ff137 <[email protected]>

* ✨ handle jetstream publish ack

Signed-off-by: ff137 <[email protected]>

* 🎨 remove use of `cast`

Signed-off-by: ff137 <[email protected]>

* 🎨 more clear setup of jetstream context, instead of just nats

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* 🎨 update NATS subject map to use `.`-pattern

Signed-off-by: ff137 <[email protected]>

* Update nats_events/README.md

Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>

* 🙈 don't ignore vscode settings

Signed-off-by: ff137 <[email protected]>

* 🔧 vscode cspell settings

Signed-off-by: ff137 <[email protected]>

* 🎨

Signed-off-by: ff137 <[email protected]>

* 🚧 add some verbose logging for testing

Signed-off-by: ff137 <[email protected]>

* 🎨 update method for nats connection args

Signed-off-by: ff137 <[email protected]>

* 🚧 debug timeout error for defining stream, change stream name

Signed-off-by: ff137 <[email protected]>

* 🚧 debug on_startup connecting to jetstream

Signed-off-by: ff137 <[email protected]>

* 🚧 test replacing . in name with _

Signed-off-by: ff137 <[email protected]>

* ✨ publish with retry -- correctly handle PubAck

Signed-off-by: ff137 <[email protected]>

* 🎨 log payload and no longer only write `with-state` records

Signed-off-by: ff137 <[email protected]>

* 🎨 fix payload log type

Signed-off-by: ff137 <[email protected]>

* 🎨 log levels

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* ✨ handle OutboundMessage type (make it serialisable)

Signed-off-by: ff137 <[email protected]>

* 🎨 retry should log error instead of raising exception

Signed-off-by: ff137 <[email protected]>

* 🎨 handle optional target types

Signed-off-by: ff137 <[email protected]>

* ✅ fix tests

Signed-off-by: ff137 <[email protected]>

* 🎨 add words to cspell list

Signed-off-by: ff137 <[email protected]>

* 🚧 remove define stream

Signed-off-by: ff137 <[email protected]>

* 🎨 define one stream with many subjects

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>
Co-authored-by: Henry Msiska <[email protected]>
Signed-off-by: ff137 <[email protected]>

* 🎨 nats_events: update log levels (#733)

* 🎨 Update log levels

Signed-off-by: ff137 <[email protected]>

* ⬆️ Upgrade uvicorn

Signed-off-by: ff137 <[email protected]>

* ⬆️ Upgrade fastapi-slim

Signed-off-by: ff137 <[email protected]>

* ⬆️ Upgrade pytest-asyncio

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

* 🐛 trace -> debug

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>

* Skip-nats-outbound-messages (#734)

* ⚡ skip outbound message types, temporarily for performance reasons

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock files

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update dependencies

Signed-off-by: ff137 <[email protected]>

* ⬆️ Update lock file

Signed-off-by: ff137 <[email protected]>

* ⏪ Revert changes to other lock files

Signed-off-by: ff137 <[email protected]>

---------

Signed-off-by: ff137 <[email protected]>
Signed-off-by: Mourits de Beer <[email protected]>
Co-authored-by: Henry Msiska <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants