Last active
January 4, 2020 22:35
-
-
Save StarpTech/91eb17613715c9b4f068ae67b7c8bcd4 to your computer and use it in GitHub Desktop.
Event Store subscription
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub, err := sc.Subscribe("eventstore.events", func(m *stan.Msg) { | |
fmt.Printf("Received a message: %s\n", string(m.Data)) | |
// your code | |
if err := m.Ack(); err != nil { | |
// event is redelivered | |
return | |
} | |
}, | |
stan.maxInFlight(1), | |
stan.AckWait("30s"), | |
stan.SetManualAckMode(), | |
stan.DurableName(durableName), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment