mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Use work queue policy, deliver all on restart
This commit is contained in:
parent
03a989d5c9
commit
9ddb8749c1
2 changed files with 4 additions and 4 deletions
|
@ -105,9 +105,9 @@ func (r *Inputer) Start() error {
|
||||||
nats.MaxDeliver(0),
|
nats.MaxDeliver(0),
|
||||||
// Use a durable named consumer.
|
// Use a durable named consumer.
|
||||||
r.Durable,
|
r.Durable,
|
||||||
// Only process one message at a time, rather than have NATS flood us with
|
// If we've missed things in the stream, e.g. we restarted, then replay
|
||||||
// more messages when we're still busy working on the last one.
|
// all of the queued messages that were waiting for us.
|
||||||
nats.MaxAckPending(1),
|
nats.DeliverAll(),
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ var (
|
||||||
var streams = []*nats.StreamConfig{
|
var streams = []*nats.StreamConfig{
|
||||||
{
|
{
|
||||||
Name: InputRoomEvent,
|
Name: InputRoomEvent,
|
||||||
Retention: nats.InterestPolicy,
|
Retention: nats.WorkQueuePolicy,
|
||||||
Storage: nats.FileStorage,
|
Storage: nats.FileStorage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue