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
@@ -774,7 +774,7 @@ public void ConfirmSelect() {
774
774
}
775
775
776
776
public void ConfirmSelect ( bool nowait ) {
777
- m_pubMsgCount = 0 ;
777
+ m_nextPubSeqNo = 1 ;
778
778
_Private_ConfirmSelect ( nowait ) ;
779
779
}
780
780
@@ -1015,8 +1015,7 @@ public void BasicPublish(string exchange,
1015
1015
{
1016
1016
basicProperties = CreateBasicProperties ( ) ;
1017
1017
}
1018
- if ( m_pubMsgCount . HasValue )
1019
- m_pubMsgCount ++ ;
1018
+ if ( m_nextPubSeqNo > 0 ) m_nextPubSeqNo ++ ;
1020
1019
_Private_BasicPublish ( exchange ,
1021
1020
routingKey ,
1022
1021
mandatory ,
You can’t perform that action at this time.
0 commit comments