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

add support for JetStream #254

Merged
merged 21 commits into from
Dec 5, 2022
Merged

add support for JetStream #254

merged 21 commits into from
Dec 5, 2022

Conversation

grimmjo
Copy link
Collaborator

@grimmjo grimmjo commented Jul 13, 2022

This PR provides JetStream support for this module.

Jetstream is a built-in distributed persistence system on top of nats-core. It has additional features likes streams, clustering, replay policies, retention policies and limits, key/value stores.
Later they will also provide a object storage.

Some related links:

Todos:

This PR depends on micronaut-projects/micronaut-core#8424

@grimmjo grimmjo force-pushed the jetstream branch 6 times, most recently from 546b2e3 to f6c86f6 Compare August 1, 2022 12:03
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 1, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 32 Code Smells

76.0% 76.0% Coverage
0.9% 0.9% Duplication

@sdelamo
Copy link
Contributor

sdelamo commented Aug 1, 2022

@grimmjo can you describe what this PR is trying to achieve? Provide as much context links as possible?

@timyates
Copy link
Contributor

timyates commented Aug 2, 2022

Cool, thanks! 😎

Looks like there's a breaking change in the configuration

You can no longer do (as shown in the documentation):

nats:
    addresses:
      - "nats://localhost:4222"
      - "nats://randomServer:4222"
    username: guest
    password: guest

You would need to change this to

nats:
    default:
        addresses:
          - "nats://localhost:4222"
          - "nats://randomServer:4222"
        username: guest
        password: guest

So this would need to be a major version release (4.0.0 at the time of writing this)

Also, this Optional looks like it may be accessed without a present check (Sonar is reporting it as a bug)

PushSubscribeOptions options =
buildConsumerConfiguration(streamName, durable,
consumerConfigurationAnnotationValue.get());

Also there's quite a few code smells which will need looking at 🤔

https://sonarcloud.io/project/issues?id=micronaut-projects_micronaut-nats&pullRequest=254&resolved=false&types=CODE_SMELL

@sdelamo sdelamo added type: enhancement New feature or request status: next major version The issue will be considered for the next major version labels Aug 2, 2022
@grimmjo
Copy link
Collaborator Author

grimmjo commented Aug 3, 2022

Hey @timyates,
thank you for your feedback 😃

The next version will be 4.0.0. I've already bumped the version to 4.0.0-SNAPSHOT.
There is still lots of things to do as for example a simple push consumer needs up to 3 annotations to work. I'm still simplifying the annotation api for this.

@grimmjo grimmjo force-pushed the jetstream branch 8 times, most recently from 7c8a9a5 to ee349f2 Compare October 11, 2022 11:59
@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud.

@grimmjo grimmjo force-pushed the jetstream branch 4 times, most recently from f55c1f9 to ccaa466 Compare October 12, 2022 07:30
Copy link
Contributor

@graemerocher graemerocher left a comment

Choose a reason for hiding this comment

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

Looks great! Just a few coments

@grimmjo grimmjo requested a review from graemerocher November 15, 2022 11:14
graemerocher
graemerocher previously approved these changes Nov 15, 2022
@graemerocher graemerocher changed the title Jetstream integration add support for JetStream Nov 15, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 11 Code Smells

75.4% 75.4% Coverage
0.0% 0.0% Duplication

@graemerocher graemerocher merged commit c066c38 into master Dec 5, 2022
@graemerocher graemerocher deleted the jetstream branch December 5, 2022 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: next major version The issue will be considered for the next major version type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants