@@ -1023,6 +1023,9 @@ await _confirmSemaphore.WaitAsync(cancellationToken)
1023
1023
_nextPublishSeqNo ++ ;
1024
1024
}
1025
1025
1026
+ await EnforceFlowControlAsync ( cancellationToken )
1027
+ . ConfigureAwait ( false ) ;
1028
+
1026
1029
var cmd = new BasicPublish ( exchange , routingKey , mandatory , default ) ;
1027
1030
1028
1031
using Activity ? sendActivity = RabbitMQActivitySource . PublisherHasListeners
@@ -1032,15 +1035,11 @@ await _confirmSemaphore.WaitAsync(cancellationToken)
1032
1035
BasicProperties ? props = PopulateBasicPropertiesHeaders ( basicProperties , sendActivity , publishSequenceNumber ) ;
1033
1036
if ( props is null )
1034
1037
{
1035
- await EnforceFlowControlAsync ( cancellationToken )
1036
- . ConfigureAwait ( false ) ;
1037
1038
await ModelSendAsync ( in cmd , in basicProperties , body , cancellationToken )
1038
1039
. ConfigureAwait ( false ) ;
1039
1040
}
1040
1041
else
1041
1042
{
1042
- await EnforceFlowControlAsync ( cancellationToken )
1043
- . ConfigureAwait ( false ) ;
1044
1043
await ModelSendAsync ( in cmd , in props , body , cancellationToken )
1045
1044
. ConfigureAwait ( false ) ;
1046
1045
}
@@ -1105,23 +1104,23 @@ await _confirmSemaphore.WaitAsync(cancellationToken)
1105
1104
_nextPublishSeqNo ++ ;
1106
1105
}
1107
1106
1107
+ await EnforceFlowControlAsync ( cancellationToken )
1108
+ . ConfigureAwait ( false ) ;
1109
+
1108
1110
var cmd = new BasicPublishMemory ( exchange . Bytes , routingKey . Bytes , mandatory , default ) ;
1111
+
1109
1112
using Activity ? sendActivity = RabbitMQActivitySource . PublisherHasListeners
1110
1113
? RabbitMQActivitySource . Send ( routingKey . Value , exchange . Value , body . Length )
1111
1114
: default ;
1112
1115
1113
1116
BasicProperties ? props = PopulateBasicPropertiesHeaders ( basicProperties , sendActivity , publishSequenceNumber ) ;
1114
1117
if ( props is null )
1115
1118
{
1116
- await EnforceFlowControlAsync ( cancellationToken )
1117
- . ConfigureAwait ( false ) ;
1118
1119
await ModelSendAsync ( in cmd , in basicProperties , body , cancellationToken )
1119
1120
. ConfigureAwait ( false ) ;
1120
1121
}
1121
1122
else
1122
1123
{
1123
- await EnforceFlowControlAsync ( cancellationToken )
1124
- . ConfigureAwait ( false ) ;
1125
1124
await ModelSendAsync ( in cmd , in props , body , cancellationToken )
1126
1125
. ConfigureAwait ( false ) ;
1127
1126
}
0 commit comments