rebus-org / Rebus.RabbitMq

:bus: RabbitMQ transport for Rebus
https://mookid.dk/category/rebus
Other
63 stars 44 forks source link

Bug with publisher confirms #37

Closed hansehe closed 5 years ago

hansehe commented 5 years ago

The publisher confirm method 'model.ConfirmSelect();' was moved to the initialization method of the model, and this leads to a bug the second time the same model is used to send a new message with the publisher confirm security.

The publisher confirm method must declare 'ConfirmSelect()', then use 'BasicPublish()', and finally confirm the sent message with 'WaitForConfirmsOrDie()'.

I am now receiving a bug from the RabbitMq.Client library stating as follows:

"Confirms not selected"

at RabbitMQ.Client.Impl.ModelBase.WaitForConfirms(TimeSpan timeout, Boolean& timedOut) at RabbitMQ.Client.Impl.ModelBase.WaitForConfirmsOrDie(TimeSpan timeout) at RabbitMQ.Client.Impl.ModelBase.WaitForConfirmsOrDie() at RabbitMQ.Client.Impl.AutorecoveringModel.WaitForConfirmsOrDie() at Rebus.RabbitMq.RabbitMqTransport.SendOutgoingMessages(ITransactionContext context, ConcurrentQueue1 outgoingMessages) at Rebus.Transport.TransactionContext.Invoke(ConcurrentQueue1 actions) at Rebus.Transport.TransactionContext.Commit() at Rebus.Retry.Simple.SimpleRetryStrategyStep.DispatchWithTrackerIdentifier(Func`1 next, String identifierToTrackMessageBy, ITransactionContext transactionContext, String messageId, String secondLevelMessageId)

I have fixed the bug in pull request: https://github.com/rebus-org/Rebus.RabbitMq/pull/36

mookid8000 commented 5 years ago

Damn, I'm so sorry! I moved it because I thought it worked the same way as transactions, where you go TxSelect once on the channel, and then the channel switches to transactional mode and stays that way forever.

Let me just accept that PR right away 😁