Nats self publish a scheduled cron message? #3384
Replies: 3 comments 5 replies
-
At this time you will need to figure out a way to publish yourself. We have had folks use TTL of a stream with max deliver of 1 and advisory for when the message can no longer be delivered, but this seems contrived at the moment. |
Beta Was this translation helpful? Give feedback.
-
Beside KV, a managed job scheduler would be a great addition to nats. |
Beta Was this translation helpful? Give feedback.
-
Something like this would be sooooo helpful: ns = await nats.connect("localhost:4222")
ns.cron.schedule("my_periodic_task_id", "*/1 * * * *", "my_topic", "my message".encode())
ns.cron.schedule("my_one-shot_task_id", "2025-04-20T18:40:00+02:00", "my_topic", "my message".encode())
ns.cron.remove("my_periodic_task_id") When these tasks are one shot they should be automatically be removed after triggering and sending their message to the target topic. |
Beta Was this translation helpful? Give feedback.
-
I'm looking to publish a message to a stream at a certain interval.
I can set up a cron job and publish a message, however I'm wondering if it's possible (or planned) to be able to schedule a message to have the nats server self publish messages at set intervals? Basically a light implementation of cron jobs on top of jetstream.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions