You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an implementation of IHandleMessages<IFailed<>> which throws an exception when the maximum retry count has been met, so that Rebus will place it in the dead letter queue. We have enabled the UseNativeDeferredMessages option.
Rebus does this, however, the value of DelaySeconds passed to SQS is a negative integer, which is invalid and SQS throws an exception. When we are iterating through our retries, we are using Defer, which updates the rbs2-deferred-until header value with a new time when the message should be retried. On the final attempt, this value is not updated.
I am of the opinion that when the GetDelaySeconds method in AmazonSqsTransport.cs is called with a DeferredUntil value in the header that is before the current time, then GetDelaySeconds should return zero, as that message should be processed without delay.
Detail of the error message thrown from the API: Rebus.Workers.ThreadPoolBased.ThreadPoolWorker An error occurred when attempting to complete the transaction context System.AggregateException: One or more errors occurred. ---> Amazon.SQS.AmazonSQSException: Failed Value -8 for parameter DelaySeconds is invalid. Reason: DelaySeconds must be >= 0 and <= 900. with Code=InvalidParameterValue, SenderFault=True
The text was updated successfully, but these errors were encountered:
ajacksms
added a commit
to ajacksms/Rebus.AmazonSQS
that referenced
this issue
Feb 26, 2018
Issue rebus-org#18 - Messages that have exhausted the retry count are being given an invalid delay value when passed to SQS
Altered the GetDelaySeconds method so that when the deferreduntil method is in the past, the message is passed to SQS with zero delay.
Added new test to verify result.
ajacksms
added a commit
to ajacksms/Rebus.AmazonSQS
that referenced
this issue
Mar 1, 2018
We have an implementation of IHandleMessages<IFailed<>> which throws an exception when the maximum retry count has been met, so that Rebus will place it in the dead letter queue. We have enabled the UseNativeDeferredMessages option.
Rebus does this, however, the value of DelaySeconds passed to SQS is a negative integer, which is invalid and SQS throws an exception. When we are iterating through our retries, we are using Defer, which updates the rbs2-deferred-until header value with a new time when the message should be retried. On the final attempt, this value is not updated.
I am of the opinion that when the GetDelaySeconds method in AmazonSqsTransport.cs is called with a DeferredUntil value in the header that is before the current time, then GetDelaySeconds should return zero, as that message should be processed without delay.
Detail of the error message thrown from the API:
Rebus.Workers.ThreadPoolBased.ThreadPoolWorker An error occurred when attempting to complete the transaction context System.AggregateException: One or more errors occurred. ---> Amazon.SQS.AmazonSQSException: Failed Value -8 for parameter DelaySeconds is invalid. Reason: DelaySeconds must be >= 0 and <= 900. with Code=InvalidParameterValue, SenderFault=True
The text was updated successfully, but these errors were encountered: