|
|
@ -1,4 +1,5 @@ |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using Rebus.Messages; |
|
|
using Rebus.Messages; |
|
|
@ -14,9 +15,12 @@ public class AbpRebusEventHandlerStep : IIncomingStep |
|
|
var message = context.Load<Message>(); |
|
|
var message = context.Load<Message>(); |
|
|
var handlerInvokers = context.Load<HandlerInvokers>().ToList(); |
|
|
var handlerInvokers = context.Load<HandlerInvokers>().ToList(); |
|
|
|
|
|
|
|
|
handlerInvokers.RemoveAll(x => x.Handler.GetType() == typeof(RebusDistributedEventHandlerAdapter<object>)); |
|
|
if (handlerInvokers.All(x => x.Handler is IRebusDistributedEventHandlerAdapter)) |
|
|
context.Save(new HandlerInvokers(message, handlerInvokers)); |
|
|
{ |
|
|
|
|
|
handlerInvokers = new List<HandlerInvoker> {handlerInvokers.Last()}; |
|
|
|
|
|
context.Save(new HandlerInvokers(message, handlerInvokers)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return next(); |
|
|
return next(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|