var tokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(5));
await publishEndpoint.Publish(message, tokenSource.Token);
PublisherConfirmation has the default value.
I have a code like this what I expect from this code is, if the publish operation hasn't been done in 5 sec then cancel the operation. Actually, it worked like this and canceled operation after 5 sec but the message was already published. So the question is; is it possible to message can be published even operation was canceled? And is this a bug or is this how we should expect? What is your advice?
If the operation was canceled, the message may have been published but not yet confirmed by RabbitMQ. Might be due to replication delays, write delays, or network latency, but that's the scenario. Make sure your broker is in good health, not overloaded, write constrained, etc.