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:
parent
172dfd1b8c
commit
6a0fdaf3ab
1 changed files with 5 additions and 5 deletions
10
processes.go
10
processes.go
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue