Created
November 17, 2012 17:56
-
-
Save andreasohlund/4098233 to your computer and use it in GitHub Desktop.
Address rewriter for use of FQDS
This file contains hidden or 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
| using NServiceBus; | |
| using NServiceBus.MessageMutator; | |
| using NServiceBus.ObjectBuilder; | |
| public class AddressRewriter:IMutateOutgoingTransportMessages,INeedInitialization | |
| { | |
| public void MutateOutgoing(object[] messages, TransportMessage transportMessage) | |
| { | |
| transportMessage.ReplyToAddress = LocalAddress; | |
| } | |
| public Address LocalAddress { get; set; } | |
| public void Init() | |
| { | |
| Configure.Instance.Configurer.ConfigureComponent<AddressRewriter>(ComponentCallModelEnum.Singleton) | |
| .ConfigureProperty(p=>p.LocalAddress,new Address(Address.Local.Queue,"TheLocalAddress")); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment