Skip to content

Instantly share code, notes, and snippets.

@andreasohlund
Created November 17, 2012 17:56
Show Gist options
  • Select an option

  • Save andreasohlund/4098233 to your computer and use it in GitHub Desktop.

Select an option

Save andreasohlund/4098233 to your computer and use it in GitHub Desktop.
Address rewriter for use of FQDS
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