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

✨ New PUBSUB - NATS JetStream support #1002

Draft
wants to merge 109 commits into
base: development
Choose a base branch
from

Conversation

mfreeman451
Copy link

@mfreeman451 mfreeman451 commented Sep 8, 2024

Pull Request Template

Description:

  • Adding support for NATS JetStream message broker
  • NATS support  #584
  • Highlight the motivation behind the changes and the expected benefits.

Breaking Changes (if applicable):

N/A

Additional Information:

  • Using NATS JetStream API
  • Include screenshots or code snippets (if necessary) to clarify the changes.

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

@mfreeman451 mfreeman451 marked this pull request as draft September 8, 2024 16:14
@aryanmehrotra
Copy link
Member

Hey, could you please check this out
https://github.com/gofr-dev/gofr/blob/development/pkg/gofr/datasource/README.md

It is mentioned to have a separate repo - but you can also create a separate package, the same way it is done for mongodb, cassandra...

this should be supported as an external package - such that users who are using it will only have it in the binary.

@vipul-rawat
Copy link
Member

Hey @mfreeman451, I think the issue is with line 38 in go.mod of gofr, you are trying to import the package which has not been published!

Also, you are introducing the packages

  • github.com/nats-io/nats.go v1.37.0 // indirect
  • github.com/nats-io/nkeys v0.4.7 // indirect
  • github.com/nats-io/nuid v1.0.1 // indirect
    But this is counterproductive as you've built the NATS datasource as a separate go module.

Not there are 2 things you could do -

  1. Remove the go.mod from the NATS implementation which would resolve most of your problems(speculative)
  2. Remove the pkg/gofr/datasource/nats dependency from the container and build them as 2 separate modules which just work as the interface defined by gofr is implemented by the nats implementation (refer to Mongo, Cassandra, etc.. implementation)

@mfreeman451
Copy link
Author

mfreeman451 commented Sep 26, 2024

Hey @mfreeman451, I think the issue is with line 38 in go.mod of gofr, you are trying to import the package which has not been published!

Also, you are introducing the packages

  • github.com/nats-io/nats.go v1.37.0 // indirect
  • github.com/nats-io/nkeys v0.4.7 // indirect
  • github.com/nats-io/nuid v1.0.1 // indirect
    But this is counterproductive as you've built the NATS datasource as a separate go module.

Not there are 2 things you could do -

  1. Remove the go.mod from the NATS implementation which would resolve most of your problems(speculative)
  2. Remove the pkg/gofr/datasource/nats dependency from the container and build them as 2 separate modules which just work as the interface defined by gofr is implemented by the nats implementation (refer to Mongo, Cassandra, etc.. implementation)

The separate go.mod is a project requirement for new integrations, not mine. If you remove the nats dep from the container then you can't initialize the NATS pubsub..

@vipul-rawat
Copy link
Member

Hey @mfreeman451, I think the issue is with line 38 in go.mod of gofr, you are trying to import the package which has not been published!
Also, you are introducing the packages

  • github.com/nats-io/nats.go v1.37.0 // indirect
  • github.com/nats-io/nkeys v0.4.7 // indirect
  • github.com/nats-io/nuid v1.0.1 // indirect
    But this is counterproductive as you've built the NATS datasource as a separate go module.

Not there are 2 things you could do -

  1. Remove the go.mod from the NATS implementation which would resolve most of your problems(speculative)
  2. Remove the pkg/gofr/datasource/nats dependency from the container and build them as 2 separate modules which just work as the interface defined by gofr is implemented by the nats implementation (refer to Mongo, Cassandra, etc.. implementation)

The separate go.mod is a project requirement for new integrations, not mine. If you remove the nats dep from the container then you can't initialize the NATS pubsub..

@mfreeman451 I understand how we need to declare new modules for the new integrations(such as they are not a direct dependency in the applications that are not using it). You can check #1054, container package to see how @aryanmehrotra implemented Azure EventHub as an external pubsub dependency.

@mfreeman451
Copy link
Author

Anything else left to do here?

@mfreeman451 mfreeman451 marked this pull request as draft October 1, 2024 20:18
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