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
try | |
{ | |
var startableBus = Configure.With(new BuiltinContainerAdapter()) | |
.Logging(l => l.None()) | |
.Transport(t => t.UseMsmqInOneWayClientMode()) | |
.CreateBus(); | |
using (var bus = startableBus.Start()) | |
{ | |
bus.Advanced.Routing.Send("NO_CHANCE_THAT_THIS_QUEUE_EXISTS", "hello there!"); |
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; | |
using System.Threading.Tasks; | |
using Rebus.Logging; | |
namespace Rebus.Threading | |
{ | |
/// <summary> | |
/// <see cref="Task"/>-based background timer thingie, that will periodically call an async <see cref="Func<Task>"/> | |
/// </summary> |
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
} | |
} | |
} | |
} | |
break; | |
} | |
} | |
} | |
} |
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
Dictionary<string, bool> usedGuids = new Dictionary<string, bool>(); | |
private string CreateUniqueGuid() | |
{ | |
string newGuid = Guid.NewGuid().ToString(); | |
if (usedGuids.ContainsKey(newGuid)) | |
{ | |
throw new Exception(); | |
} |
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
foreach(var derivedMessageType in GetAllMessageTypes().Where(t => typeof(IBaseMessage).IsAssignableFrom(t)) | |
{ | |
bus.GetType().GetMethod("Subscribe").MakeGenericMethod(derivedMessageType).Invoke(bus, new object[0]); | |
} |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" /> | |
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" /> | |
</configSections> | |
<MsmqTransportConfig InputQueue="someClient" | |
ErrorQueue="error" | |
NumberOfWorkerThreads="1" |
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
var bus = Configure.With() | |
.DefaultBuilder() | |
.XmlSerializer() | |
.MsmqTransport().IsTransactional(false) | |
.UnicastBus().LoadMessageHandlers() | |
.CreateBus() | |
.Start(); |
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
public class EndpointConfiguration : IConfigureThisEndpoint, | |
IWantCustomLogging, | |
IWantCustomInitialization | |
{ | |
public void Init() | |
{ | |
Configure.With() | |
.DefaultBuilder() | |
.XmlSerializer() | |
.MsmqTransport() |
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
public class EndpointConfiguration : IConfigureThisEndpoint, | |
AsA_Server, | |
IWantCustomInitialization, | |
IWantToRunAtStartup | |
{ | |
readonly IWindsorContainer container; | |
public EndpointConfiguration() | |
{ | |
container = new WindsorContainerDecorator() |
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
public interface ICommand : IMessage {} | |
public interface IEvent : IMessage {} | |
public interface IRequest : IMessage {} | |
public interface IReply : IMessage {} |
OlderNewer