sdk-go: sdk-go for amp protocol is not able to settle 1 out of 10 messages in my POC consitently

When I used the example to send 10 messages , the client is able to receive only 9 out of 10 messages. The sender hangs waiting for acknowledge for ever. In my opnion it should at least fail or time out, so the sender can resend the message. The POC I created to test this scenario can be found here, You can recreate this problem either by running in the cluster or stand alone https://github.com/aneeshkp/cloudevents-amqp I see following in the QDR logs

 ROUTER_CORE (info) [C29][L63] Stuck delivery: At least one delivery on this link has been undelivered/unsettled for more than 10 seconds

Sending 10 messages , you can see following message in the log ( its same behaviour if I send 100 messages too, 1 will be not settled)

2021/01/19 14:50:26 All 10 message was sent
2021/01/19 14:50:26 Total 1 messages were unsettled
2021/01/19 14:50:26 Unsettled messages
2021/01/19 14:50:26 --------------------
2021/01/19 14:50:26 Message id `2` was not settled and waitng
2021/01/19 14:50:26 --------------------
2021/01/19 14:50:26 Out of 10 messages ,Only 9 was settled

with 100 messages

2021/01/19 15:15:59 100 MESSAGE SUCCESSFULLY DELIVERED <nil>
2021/01/19 15:15:59 --------- Summary ----------
2021/01/19 15:15:59 All 100 message was sent
2021/01/19 15:15:59 Total 1 messages were unsettled
2021/01/19 15:15:59 Unsettled messages
2021/01/19 15:15:59 --------------------
2021/01/19 15:15:59 Message id `2` was not settled and waiting
2021/01/19 15:15:59 --------------------
2021/01/19 15:15:59 Out of 100 messages ,Only 99 was settled

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Just a minor remark: The term queue is not really compliant with AMQP terminology. AMQP only knows links with source and target and does not imply the presence of a queue.

@slinkydeveloper I will work with @aneeshkp for a fix. The problem is that NewProtocol only takes a single queue arg,

func NewProtocol(server, queue string, connOption []amqp.ConnOption, sessionOption []amqp.SessionOption, opts …Option) (*Protocol, error)

NewProtocol creates both a sender and a receiver with the same name. NewProtocol needs to specify two different names as the transmit queue and receive queues are unrelated.