-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add IMessageMutator and IMessageTopicRouter configuration interfaces
change CurrentMessageInformation implementation to ThreadStatic
- Loading branch information
Showing
6 changed files
with
226 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace NsqSharp.Bus.Configuration | ||
{ | ||
/// <summary> | ||
/// Implement this interface to modify a message before it is sent. | ||
/// </summary> | ||
public interface IMessageMutator | ||
{ | ||
/// <summary> | ||
/// Gets a mutated message before it is sent. | ||
/// </summary> | ||
/// <typeparam name="T">The message type.</typeparam> | ||
/// <param name="bus">The bus sending this message.</param> | ||
/// <param name="sentMessage">The message about to be sent.</param> | ||
/// <returns>The mutated message.</returns> | ||
T GetMutatedMessage<T>(IBus bus, T sentMessage); | ||
} | ||
} |
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,21 @@ | ||
using NsqSharp.Bus.Configuration.Providers; | ||
|
||
namespace NsqSharp.Bus.Configuration | ||
{ | ||
/// <summary> | ||
/// Implement this interface to specify custom message-to-topic routing logic based on a message object about to be sent. | ||
/// </summary> | ||
public interface IMessageTopicRouter | ||
{ | ||
/// <summary> | ||
/// Gets the topic a message should be sent on. | ||
/// </summary> | ||
/// <typeparam name="T">The message type.</typeparam> | ||
/// <param name="bus">The bus sending this message.</param> | ||
/// <param name="originalTopic">The original topic name as provided by the implementation | ||
/// of <see cref="IMessageTypeToTopicProvider"/> passed to this bus.</param> | ||
/// <param name="sentMessage">The message about to be sent.</param> | ||
/// <returns>The topic to send this message on.</returns> | ||
string GetMessageTopic<T>(IBus bus, string originalTopic, T sentMessage); | ||
} | ||
} |
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
Oops, something went wrong.