File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
projects/client/RabbitMQ.Client/src/client Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 2877
2877
persisted it if required).
2878
2878
2879
2879
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
2881
2881
confirms messages by sending Basic.Ack methods referring to these
2882
2882
sequence numbers.
2883
2883
</doc >
Original file line number Diff line number Diff line change @@ -143,9 +143,9 @@ public interface IModel: IDisposable
143
143
///== null.</summary>
144
144
bool IsOpen { get ; }
145
145
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 ; }
149
149
150
150
///<summary>Construct a completely empty content header for
151
151
///use with the Basic content class.</summary>
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ public abstract class ModelBase : IFullModel
89
89
public ManualResetEvent m_flowControlBlock = new ManualResetEvent ( true ) ;
90
90
private readonly object m_flowSendLock = new object ( ) ;
91
91
92
- private ulong ? m_pubMsgCount = null ;
92
+ private ulong m_nextPubSeqNo ;
93
93
94
94
public event ModelShutdownEventHandler ModelShutdown
95
95
{
@@ -458,11 +458,11 @@ public bool IsOpen
458
458
}
459
459
}
460
460
461
- public ulong ? PublishedMessageCount
461
+ public ulong NextPublishSeqNo
462
462
{
463
463
get
464
464
{
465
- return m_pubMsgCount ;
465
+ return m_nextPubSeqNo ;
466
466
}
467
467
}
468
468
@@ -753,7 +753,7 @@ public void ConfirmSelect() {
753
753
}
754
754
755
755
public void ConfirmSelect ( bool nowait ) {
756
- m_pubMsgCount = 0 ;
756
+ m_nextPubSeqNo = 1 ;
757
757
_Private_ConfirmSelect ( nowait ) ;
758
758
}
759
759
@@ -994,8 +994,7 @@ public void BasicPublish(string exchange,
994
994
{
995
995
basicProperties = CreateBasicProperties ( ) ;
996
996
}
997
- if ( m_pubMsgCount . HasValue )
998
- m_pubMsgCount ++ ;
997
+ if ( m_nextPubSeqNo > 0 ) m_nextPubSeqNo ++ ;
999
998
_Private_BasicPublish ( exchange ,
1000
999
routingKey ,
1001
1000
mandatory ,
You can’t perform that action at this time.
0 commit comments