Skip to content

nats-streaming is always creating a group #86

@slawo

Description

@slawo

subscription, err := conn.QueueSubscribe(mq.topic, mq.consumerID, f, opts...)

subscription, err := conn.QueueSubscribe(mq.topic, mq.consumerID, f, opts...) creates a group.

opts = append(opts, stan.DurableName(mq.consumerID))

By default the library creates a durable connection

conn, err := stan.Connect(mq.clusterID, mq.consumerID+generateID(), stan.NatsURL(mq.natsURL), stan.SetConnectionLostHandler(func(_ stan.Conn, e error) {

adding to this mq.consumerID+generateID() creates a new client id on each reconnect which creates a major issue in case of staled connections as even with 1 inflight a message can be waiting to timeout wile a consumer reconnects to the same group with a new client id and gets next events... when the stalled connection dies or the message timeout on nats server the message is released and re-delivered out of order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions