Skip to content

Commit 43bf5b9

Browse files
author
Marek Majkowski
committed
bug22942 merged into default
2 parents 5077304 + 7c72d15 commit 43bf5b9

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

@@ -774,7 +774,7 @@ public void ConfirmSelect() {
774774
}
775775

776776
public void ConfirmSelect(bool nowait) {
777-
m_pubMsgCount = 0;
777+
m_nextPubSeqNo = 1;
778778
_Private_ConfirmSelect(nowait);
779779
}
780780

@@ -1015,8 +1015,7 @@ public void BasicPublish(string exchange,
10151015
{
10161016
basicProperties = CreateBasicProperties();
10171017
}
1018-
if (m_pubMsgCount.HasValue)
1019-
m_pubMsgCount++;
1018+
if (m_nextPubSeqNo > 0) m_nextPubSeqNo++;
10201019
_Private_BasicPublish(exchange,
10211020
routingKey,
10221021
mandatory,

0 commit comments

Comments
 (0)