-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
193 additions
and
294 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
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
39 changes: 0 additions & 39 deletions
39
src/gateway/NServiceBus.Gateway/Routing/Endpoints/LegacyEndpointRouter.cs
This file was deleted.
Oops, something went wrong.
75 changes: 39 additions & 36 deletions
75
src/gateway/NServiceBus.Gateway/Routing/Sites/LegacySiteRouter.cs
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 |
---|---|---|
@@ -1,37 +1,40 @@ | ||
namespace NServiceBus.Gateway.Routing.Sites | ||
{ | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using Channels; | ||
using Unicast.Transport; | ||
|
||
public class LegacySiteRouter:IRouteMessagesToSites | ||
{ | ||
readonly string remoteUrl; | ||
|
||
public LegacySiteRouter() | ||
{ | ||
remoteUrl = ConfigurationManager.AppSettings["RemoteUrl"]; | ||
} | ||
|
||
public IEnumerable<Site> GetDestinationSitesFor(TransportMessage messageToDispatch) | ||
{ | ||
var address = GetRemoteAddress(messageToDispatch); | ||
|
||
return new []{new Site | ||
{ | ||
Channel = new Channel{Address = address,Type = "Http"}, | ||
Key = address | ||
}}; | ||
} | ||
|
||
string GetRemoteAddress(TransportMessage msg) | ||
{ | ||
if (msg.Headers.ContainsKey(Headers.HttpTo)) | ||
return msg.Headers[Headers.HttpTo]; | ||
|
||
return remoteUrl; | ||
} | ||
|
||
} | ||
namespace NServiceBus.Gateway.Routing.Sites | ||
{ | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using Channels; | ||
using Unicast.Transport; | ||
|
||
public class LegacySiteRouter : IRouteMessagesToSites | ||
{ | ||
private readonly string remoteUrl; | ||
|
||
public LegacySiteRouter() | ||
{ | ||
remoteUrl = ConfigurationManager.AppSettings["RemoteUrl"]; | ||
} | ||
|
||
public IEnumerable<Site> GetDestinationSitesFor(TransportMessage messageToDispatch) | ||
{ | ||
var address = GetRemoteAddress(messageToDispatch); | ||
|
||
return new[] | ||
{ | ||
new Site | ||
{ | ||
Channel = new Channel {Address = address, Type = "Http"}, | ||
Key = address | ||
} | ||
}; | ||
} | ||
|
||
private string GetRemoteAddress(TransportMessage msg) | ||
{ | ||
if (msg.Headers.ContainsKey(Headers.HttpTo)) | ||
return msg.Headers[Headers.HttpTo]; | ||
|
||
return remoteUrl; | ||
} | ||
|
||
} | ||
} |
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
Oops, something went wrong.