Skip to content

Commit 7c72d15

Browse files
author
Matthew Sackman
committed
Merging bug23616 into default
2 parents eacdb8b + 9525559 commit 7c72d15

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

docs/specs/amqp0-9-1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2877,7 +2877,7 @@
28772877
persisted it if required).
28782878

28792879
Published messages are assigned ascending sequence numbers,
2880-
starting at 0 when the Confirm.Select method is used. The server
2880+
starting at 1 with the first Confirm.Select method. The server
28812881
confirms messages by sending Basic.Ack methods referring to these
28822882
sequence numbers.
28832883
</doc>

projects/client/RabbitMQ.Client/src/client/api/IModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ public interface IModel: IDisposable
143143
///== null.</summary>
144144
bool IsOpen { get; }
145145

146-
///<summary>Returns the number of messages published since the
147-
///channel was put in confirm mode.</summary>
148-
ulong? PublishedMessageCount { get; }
146+
///<summary>When in confirm mode, return the sequence number
147+
///of the next message to be published.</summary>
148+
ulong NextPublishSeqNo { get; }
149149

150150
///<summary>Construct a completely empty content header for
151151
///use with the Basic content class.</summary>

projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public abstract class ModelBase : IFullModel
8989
public ManualResetEvent m_flowControlBlock = new ManualResetEvent(true);
9090
private readonly object m_flowSendLock = new object();
9191

92-
private ulong? m_pubMsgCount = null;
92+
private ulong m_nextPubSeqNo;
9393

9494
public event ModelShutdownEventHandler ModelShutdown
9595
{
@@ -458,11 +458,11 @@ public bool IsOpen
458458
}
459459
}
460460

461-
public ulong? PublishedMessageCount
461+
public ulong NextPublishSeqNo
462462
{
463463
get
464464
{
465-
return m_pubMsgCount;
465+
return m_nextPubSeqNo;
466466
}
467467
}
468468

@@ -753,7 +753,7 @@ public void ConfirmSelect() {
753753
}
754754

755755
public void ConfirmSelect(bool nowait) {
756-
m_pubMsgCount = 0;
756+
m_nextPubSeqNo = 1;
757757
_Private_ConfirmSelect(nowait);
758758
}
759759

@@ -994,8 +994,7 @@ public void BasicPublish(string exchange,
994994
{
995995
basicProperties = CreateBasicProperties();
996996
}
997-
if (m_pubMsgCount.HasValue)
998-
m_pubMsgCount++;
997+
if (m_nextPubSeqNo > 0) m_nextPubSeqNo++;
999998
_Private_BasicPublish(exchange,
1000999
routingKey,
10011000
mandatory,

0 commit comments

Comments
 (0)