Created
November 6, 2018 08:19
-
-
Save SzymonPobiega/ac1a3f7e0f9f65c8907df3220740d815 to your computer and use it in GitHub Desktop.
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
using System; | |
using System.Threading.Tasks; | |
using NServiceBus; | |
using NServiceBus.Persistence; | |
namespace Backend | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
StartBackend().GetAwaiter().GetResult(); | |
StartFrontend().GetAwaiter().GetResult(); | |
} | |
static async Task StartBackend() | |
{ | |
var config = new EndpointConfiguration("Backend"); | |
config.UseTransport<MsmqTransport>(); | |
var persistence = config.UsePersistence<NHibernatePersistence>(); | |
persistence.ConnectionString("data source=(local); initial catalog=nservicebus; integrated security=true"); | |
config.EnableInstallers(); | |
config.SendFailedMessagesTo("error"); | |
config.EnableOutbox(); | |
var endpoint = await Endpoint.Start(config); | |
Console.WriteLine("Press <enter> to exit"); | |
Console.ReadLine(); | |
await endpoint.Stop(); | |
} | |
static async Task StartFrontend() | |
{ | |
var config = new EndpointConfiguration("Frontend"); | |
config.UseTransport<MsmqTransport>(); | |
var persistence = config.UsePersistence<NHibernatePersistence>(); | |
persistence.ConnectionString("data source=(local); initial catalog=nservicebus; integrated security=true"); | |
config.EnableInstallers(); | |
config.SendFailedMessagesTo("error"); | |
config.EnableOutbox(); | |
config.MakeInstanceUniquelyAddressable("ABC"); | |
var endpoint = await Endpoint.Start(config); | |
Console.WriteLine("Press <enter> to exit"); | |
Console.ReadLine(); | |
await endpoint.Stop(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment