Skip to content

Commit

Permalink
fixup heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall committed Dec 15, 2024
1 parent 1627fc9 commit 3261f40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stomp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func runStompSubscribers(config *scyllaridae.ServerConfig) {
func RecvAndProcessMessage(queueName string, middleware scyllaridae.QueueMiddleware) error {
addr := os.Getenv("STOMP_SERVER_ADDR")
if addr == "" {
addr = "activemq:61613"
addr = "activemq:61613?activemq.prefetchSize=1"
}

c, err := net.Dial("tcp", addr)
Expand All @@ -78,7 +78,7 @@ func RecvAndProcessMessage(queueName string, middleware scyllaridae.QueueMiddlew
return err
}

conn, err := stomp.Connect(tcpConn, stomp.ConnOpt.HeartBeat(10*time.Second, 0*time.Second))
conn, err := stomp.Connect(tcpConn, stomp.ConnOpt.HeartBeat(10*time.Second, 10*time.Second))
if err != nil {
slog.Error("Cannot connect to STOMP server", "err", err.Error())
return err
Expand All @@ -89,7 +89,7 @@ func RecvAndProcessMessage(queueName string, middleware scyllaridae.QueueMiddlew
slog.Error("Problem disconnecting from STOMP server", "err", err)
}
}()
sub, err := conn.Subscribe(queueName, stomp.AckClient)
sub, err := conn.Subscribe(queueName, stomp.AckClient, stomp.SubscribeOpt.Prefetch(1))

Check failure on line 92 in stomp.go

View workflow job for this annotation

GitHub Actions / lint-test

stomp.SubscribeOpt.Prefetch undefined (type struct{Id func(id string) func(*frame.Frame) error; Header func(key string, value string) func(*frame.Frame) error} has no field or method Prefetch) (typecheck)
if err != nil {
slog.Error("Cannot subscribe to queue", "queue", queueName, "err", err.Error())
return err
Expand Down

0 comments on commit 3261f40

Please sign in to comment.