Skip to content

Commit

Permalink
chore(worker): use subject constant
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrizio Sestito <[email protected]>
  • Loading branch information
fabriziosestito committed Oct 8, 2024
1 parent 1dfa442 commit 0880979
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ import (
"time"

"github.com/nats-io/nats.go"
"github.com/rancher/sbombastic/internal/messaging"
)

func main() {
nc, err := nats.Connect("nats://controller-nats.sbombastic.svc.cluster.local")
nc, err := nats.Connect("nats://controller-nats.sbombastic.svc.cluster.local")
if err != nil {
log.Fatal(err)
}

// Use the JetStream context to produce and consumer messages
// that have been persisted.
js, err := nc.JetStream(nats.PublishAsyncMaxPending(256))
if err != nil {
log.Fatal(err)
}

sub, err := js.PullSubscribe("sbombastic", "worker", nats.InactiveThreshold(24*time.Hour))
sub, err := js.PullSubscribe(messaging.SbombasticSubject, "worker", nats.InactiveThreshold(24*time.Hour))
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 0880979

Please sign in to comment.