1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

renamed stream to nodes

This commit is contained in:
postmannen 2024-11-21 21:49:23 +01:00
parent 172dfd1b8c
commit 6a0fdaf3ab

View file

@ -347,9 +347,9 @@ func (p *processes) Start(proc process) {
}
_, err = js.CreateOrUpdateStream(proc.ctx, jetstream.StreamConfig{
Name: "orders",
Description: "orders stream",
Subjects: []string{"orders.>"},
Name: "nodes",
Description: "nodes stream",
Subjects: []string{"nodes.>"},
// Discard older messages and keep only the last one.
MaxMsgsPerSubject: 1,
})
@ -361,7 +361,7 @@ func (p *processes) Start(proc process) {
i := 0
for {
// TODO:
_, err := js.Publish(proc.ctx, "orders.shop1", []byte(fmt.Sprintf("order nr. %v", i)))
_, err := js.Publish(proc.ctx, "nodes.btdev1", []byte(fmt.Sprintf("message nr. %v", i)))
if err != nil {
log.Fatalf("error: js failed to publish message: %v\n", err)
}
@ -380,7 +380,7 @@ func (p *processes) Start(proc process) {
log.Fatalf("error: jetstream new failed: %v\n", err)
}
stream, err := js.Stream(proc.ctx, "orders")
stream, err := js.Stream(proc.ctx, "nodes")
if err != nil {
log.Fatalf("error: js.Stream failed: %v\n", err)
}