nats-streaming-server icon indicating copy to clipboard operation
nats-streaming-server copied to clipboard

Query / Export Persisted Messages, Separate from a NATS Client

Open sfrooster opened this issue 8 years ago • 4 comments

Persistent, ordered and highly-available messages enable a great many client use cases (support for recovery from client down time, cluster healing etc).

There are additional use cases where being able to (minimally) filter/query historic messages and export the results to pre-defined format in non-realtime (or near real-time if possible). For example:

  • audit trail / compliance reporting
  • production debugging
  • alternate outcome testing
  • shovel to a data pipeline / analytics / optimizing projections

First thoughts are you should be able to filter by topic, date range and sequence range.

sfrooster avatar Aug 18 '16 07:08 sfrooster

This could be as easy as providing an alternative to deleting the oldest DAT file, and some CLI tooling to export all messages in a DAT to a stringified JSON array (file).

sfrooster avatar Oct 11 '16 02:10 sfrooster

Would providing the format of the file be an useful feature? If the store files are large, it may be more useful to simply expose their format, and write tools against that.

aricart avatar Oct 11 '16 16:10 aricart

The format(s) would be good, or a lib to write tools against, and then maybe a command line option for specifying an external tool to call at file switch, where it'd be passed some arguments like old file + path. I don't know. We'd have to talk about it, but the idea would be to override the default behavior of deleting the oldest file when the max number of messages is reached.

sfrooster avatar Oct 11 '16 17:10 sfrooster

This is partially covered by #201

sfrooster avatar Nov 24 '16 02:11 sfrooster