Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
7ce8d0ef
Unverified
Commit
7ce8d0ef
authored
Sep 16, 2025
by
Michael Feil
Committed by
GitHub
Sep 17, 2025
Browse files
feat: make connect_with_reset jetstream configurable (#3078)
Signed-off-by:
michaelfeil
<
me@michaelfeil.eu
>
parent
d49fc3eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
lib/runtime/src/transports/nats.rs
lib/runtime/src/transports/nats.rs
+7
-2
No files found.
lib/runtime/src/transports/nats.rs
View file @
7ce8d0ef
...
@@ -514,12 +514,17 @@ impl NatsQueue {
...
@@ -514,12 +514,17 @@ impl NatsQueue {
let
client
=
client_options
.connect
()
.await
?
;
let
client
=
client_options
.connect
()
.await
?
;
// messages older than a hour in the stream will be automatically purged
let
max_age
=
std
::
env
::
var
(
"DYN_NATS_STREAM_MAX_AGE"
)
.ok
()
.and_then
(|
s
|
s
.parse
::
<
u64
>
()
.ok
())
.map
(
time
::
Duration
::
from_secs
)
.unwrap_or_else
(||
time
::
Duration
::
from_secs
(
60
*
60
));
// Always try to create the stream (removes the race condition)
// Always try to create the stream (removes the race condition)
let
stream_config
=
jetstream
::
stream
::
Config
{
let
stream_config
=
jetstream
::
stream
::
Config
{
name
:
self
.stream_name
.clone
(),
name
:
self
.stream_name
.clone
(),
subjects
:
vec!
[
self
.subject
.clone
()],
subjects
:
vec!
[
self
.subject
.clone
()],
// messages older than a hour in the stream will be automatically purged
max_age
,
max_age
:
time
::
Duration
::
from_secs
(
60
*
60
),
..
Default
::
default
()
..
Default
::
default
()
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment