Commit a353232
committed
Add stream created datetime to StreamInfo
The field is already exposed by NATS "$JS.API.STREAM.INFO.{name}" API: https://nats-io.github.io/nats.js/jetstream/types/StreamInfo.html
Since it's official part of protocol, let's expose it to the user.
Golang implementation already do so: https://github.com/nats-io/nats.go/blob/4ec2f446e4cd829a7be3bf9aa16c43a7fddeaed9/jetstream/stream_config.go#L32
Example API response:
```json
{
"type": "io.nats.jetstream.api.v1.stream_info_response",
"total": 0,
"offset": 0,
"limit": 0,
"created": "2025-11-02T15:34:21.730004852Z",
"config": {
"name": "stream",
"subjects": [
"test.>"
],
"retention": "limits",
"max_consumers": -1,
"max_msgs": -1,
"max_bytes": 2147483648,
"max_age": 86400000000000,
"max_msgs_per_subject": -1,
"max_msg_size": -1,
"discard": "old",
"storage": "file",
"num_replicas": 1,
"duplicate_window": 120000000000,
"compression": "s2",
"allow_direct": false,
"mirror_direct": false,
"sealed": false,
"deny_delete": false,
"deny_purge": false,
"allow_rollup_hdrs": false,
"consumer_limits": {}
},
"state": {
"messages": 1249954,
"bytes": 1036040689,
"first_seq": 3326784,
"first_ts": "2025-11-03T08:38:40.571255423Z",
"last_seq": 4576737,
"last_ts": "2025-11-03T13:34:30.52654449Z",
"num_subjects": 2,
"consumer_count": 1
},
"cluster": {
"leader": "nats-0"
},
"ts": "2025-11-03T13:34:30.530396449Z"
}
```1 parent 9afa315 commit a353232
2 files changed
+20
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
88 | 100 | | |
89 | 101 | | |
90 | 102 | | |
| |||
410 | 422 | | |
411 | 423 | | |
412 | 424 | | |
| 425 | + | |
413 | 426 | | |
414 | 427 | | |
415 | 428 | | |
| |||
418 | 431 | | |
419 | 432 | | |
420 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
421 | 440 | | |
422 | 441 | | |
423 | 442 | | |
| |||
711 | 730 | | |
712 | 731 | | |
713 | 732 | | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | 733 | | |
726 | 734 | | |
727 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
| 1254 | + | |
1254 | 1255 | | |
1255 | 1256 | | |
1256 | 1257 | | |
| |||
0 commit comments