Skip to content

[BUG] Cannot acknowledge messages that come in without a topicName in MessageID #287

Description

@banum2-ppb

Description

Depending on the producer (fs-client, java, KOP etc) sometimes messages come in without a topicName inside MessageID

Image

Acknowledging this type of message breaks in
await _subConsumers[messageId.Topic].Acknowledge(messageId, cancellationToken).ConfigureAwait(false);
because messageId.Topic == ""

the consumer already has the topicName and I think the Acknowledge should create the topicName based on the other fields if the topicName is missing.

Reproduction Steps

.

Expected behavior

.

Actual behavior

.

Regression?

No response

Known Workarounds

Recreating the messageID is a work-around for this issue.

var ackM = new MessageId(message.MessageId.LedgerId, 
                message.MessageId.EntryId, 
                message.MessageId.Partition,
                message.MessageId.BatchIndex, 
                $"{_consumer.Topic}-partition-{message.MessageId.Partition}");
await _consumer!.Acknowledge(ackM);

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions