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

[ADDED] JetStream: Direct Get Message #562

Merged
merged 1 commit into from
Jul 20, 2022
Merged

[ADDED] JetStream: Direct Get Message #562

merged 1 commit into from
Jul 20, 2022

Conversation

kozlovic
Copy link
Member

This starts with a new boolean in a stream configuration:

// Allow higher performance, direct access to get individual messages. E.g. KeyValue
bool  AllowDirect;

When a stream is created with that boolean, then it is possible
to use this API to get messages:

natsStatus
js_DirectGetMsg(natsMsg **msg, jsCtx *js, const char *stream, jsOptions *opts, jsDirectGetMsgOptions *dgOpts);

The possible options to get a message are:

typedef struct jsDirectGetMsgOptions
{
        uint64_t        Sequence;               ///< Get the message at this sequence
        const char      *NextBySubject;         ///< Get the next message (based on sequence) for that subject
        const char      *LastBySubject;         ///< Get the last message on that subject

} jsDirectGetMsgOptions;

Signed-off-by: Ivan Kozlovic ivan@synadia.com

This starts with a new boolean in a stream configuration:
```
// Allow higher performance, direct access to get individual messages. E.g. KeyValue
bool  AllowDirect;
```

When a stream is created with that boolean, then it is possible
to use this API to get messages:
```
natsStatus
js_DirectGetMsg(natsMsg **msg, jsCtx *js, const char *stream, jsOptions *opts, jsDirectGetMsgOptions *dgOpts);
```

The possible options to get a message are:
```
typedef struct jsDirectGetMsgOptions
{
        uint64_t        Sequence;               ///< Get the message at this sequence
        const char      *NextBySubject;         ///< Get the next message (based on sequence) for that subject
        const char      *LastBySubject;         ///< Get the last message on that subject

} jsDirectGetMsgOptions;
```

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@kozlovic kozlovic merged commit 418dd00 into main Jul 20, 2022
@kozlovic kozlovic deleted the js_direct_get branch July 20, 2022 19: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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants