Commit cd99131
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 1517e53 commit cd99131
2 files changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
413 | 414 | | |
414 | 415 | | |
415 | 416 | | |
| |||
418 | 419 | | |
419 | 420 | | |
420 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1215 | 1215 | | |
1216 | 1216 | | |
1217 | 1217 | | |
| 1218 | + | |
1218 | 1219 | | |
1219 | 1220 | | |
1220 | 1221 | | |
| |||
0 commit comments