-
Notifications
You must be signed in to change notification settings - Fork 5
feature: add ackwait
config
#190
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
base: master
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe pull request introduces an Changes
Sequence DiagramsequenceDiagram
participant Config as Configuration
participant Driver as NATS Job Driver
participant Listener as Message Listener
Config->>Driver: Set AckWait Duration
Driver->>Listener: Configure Consumer AckWait
Listener-->>Driver: Apply Acknowledgment Timeout
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Hey @shellphy 👋🏻 I'm not sure, you just added a configuration option and skip using it anywhere? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
natsjobs/config.go (1)
34-34
: Add documentation for the AckWait field.Please add a comment explaining the purpose and expected format of the AckWait configuration field.
+ // AckWait is the duration the server should wait for an ack before resending a message AckWait time.Duration `mapstructure:"ack_wait"`
natsjobs/driver.go (1)
52-55
: Improve field grouping in Driver struct.Consider grouping related fields together for better readability. The NATS-related fields should be grouped together.
// nats consumer *consumer consumerLock sync.RWMutex conn *nats.Conn - - stream jetstream.Stream - jetstream jetstream.JetStream - msgCh chan jetstream.Msg + stream jetstream.Stream + jetstream jetstream.JetStream + msgCh chan jetstream.Msg
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.work.sum
is excluded by!**/*.sum
📒 Files selected for processing (3)
natsjobs/config.go
(2 hunks)natsjobs/driver.go
(6 hunks)natsjobs/listener.go
(1 hunks)
🔇 Additional comments (1)
natsjobs/listener.go (1)
22-22
: LGTM!The AckWait configuration is correctly integrated into the NATS JetStream consumer configuration.
listener.go: cons, err := c.jetstream.CreateConsumer(ctx, c.streamID, jetstream.ConsumerConfig{
Name: id,
MaxAckPending: c.prefetch,
AckPolicy: jetstream.AckExplicitPolicy,
AckWait: c.ackWait,
}) |
@shellphy Could you please also update documentation? |
@shellphy PHP part: https://github.com/roadrunner-php/jobs/blob/4.x/src/Queue/NatsCreateInfo.php should be synced as well (ack_wait constant). |
Hey @shellphy 👋🏻 |
@shellphy Friendly ping, do you have plans to continue working on this PR? |
Reason for This PR
Avoid duplication of tasks
Description of Changes
This is a simpler implementation of #189.
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).CHANGELOG.md
.Summary by CodeRabbit
New Features
Improvements
AckWait
parameter to provide more control over message processing timeouts