public void Handle(Envelope <TPayload> message) { try { _inner.Handle(message); message = message.RedirectToTopic(_outputTopic); _messageBus.PublishEnvelope(message); } catch (Exception e) { _messageBus.Publish(_errorTopic, new NodeErrorMessage <TPayload>(_nodeKey, message.Payload, e)); } }
private static Action <TPayload> CreateAction(IPubSubBus messageBus, string channelName) { void NewAction(TPayload t) => messageBus.Publish(channelName, t); return(NewAction); }