Open dnwe opened 7 years ago
@dnwe hm yeah you're right (man those are killer names for the two modes 'first' and 'second' :) ). Though it wouldn't take too much effort to track messages and settle them upon disposition (for the second
case), it's not clear whether anyone is actually using that because nobody has complained of the aforementioned debug messages on ReceiverLink.prototype._dispositionReceived
.
Currently the amqp10 module seems to have re-purposed AMQP's rcv-settle-mode on a receiver link to determine whether or not the client library itself should be doing automatic settlement when messages received, or whether to expect the user to call
.accept()
to settle received messages.However, I think this is incorrect. The rcv-settle-mode FIRST vs SECOND is specifically governing the contract between sender and receiver link as to who MUST send the settlement disposition first.
From the spec
Currently the 'SECOND' behaviour isn't implemented by the module, as per:
I think for now the right thing would be to permanently lock rcv-settle-mode to FIRST to have AMQP.Constants.receiverSettleMode.autoSettle and AMQP.Constants.receiverSettleMode.manualSettle to simply distinguish whether or not the user plans to settle messages themselves.