-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved extensibility of gateway to allow for dropping in an assembl…
…y which will be notified of messages processed by the gateway.
- Loading branch information
Showing
7 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using NServiceBus.Unicast.Transport; | ||
|
||
namespace NServiceBus.Gateway | ||
{ | ||
public interface INotifyAboutMessages | ||
{ | ||
event EventHandler<MessageTransportArgs> MessageProcessed; | ||
} | ||
|
||
public class MessageTransportArgs : EventArgs | ||
{ | ||
public TransportTypeEnum TransportType { get; set;} | ||
public TransportMessage Message { get; set; } | ||
} | ||
|
||
public enum TransportTypeEnum { FromHttpToMsmq, FromMsmqToHttp } | ||
|
||
internal interface IMessageNotifier : INotifyAboutMessages | ||
{ | ||
void RaiseMessageProcessed(TransportTypeEnum transportType, TransportMessage message); | ||
} | ||
|
||
internal class MessageNotifier : IMessageNotifier | ||
{ | ||
public event EventHandler<MessageTransportArgs> MessageProcessed; | ||
|
||
void IMessageNotifier.RaiseMessageProcessed(TransportTypeEnum transportType, TransportMessage message) | ||
{ | ||
if (MessageProcessed != null) | ||
MessageProcessed(this, new MessageTransportArgs { TransportType = transportType, Message = message }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.