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
| namespace NServiceBus.Persistence.Raven.Tests | |
| { | |
| using System; | |
| using System.IO; | |
| using System.Messaging; | |
| using System.Threading; | |
| using System.Transactions; | |
| using NUnit.Framework; | |
| using global::Raven.Client; | |
| using global::Raven.Client.Document; |
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
| [Fact] | |
| public void NSBTest() | |
| { | |
| this.kernel.Bind<Foo>().ToSelf().InTransientScope(); | |
| this.kernel.Bind<Foo>().ToSelf().WhenAnyAnchestorNamed("Container").InNamedScope("Container"); | |
| this.kernel.Bind<ChildContainer>().ToSelf().Named("Container").DefinesNamedScope("Container"); | |
| var instance1 = this.kernel.Get<Foo>(); | |
| instance1.Should().NotBeNull(); | |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <configSections> | |
| <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> | |
| <section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" /> | |
| </configSections> | |
| <log4net debug="false"> | |
| <appender name="FileAppender" type="log4net.Appender.FileAppender"> | |
| <file value="myLog.txt"/> |
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
| Configure.Instance | |
| .ForInstallationOn<NServiceBus.Installation.Environments.Windows>() | |
| .Install() |
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
| Configure.With() | |
| .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith("Commands")) | |
| .DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith("Events")) | |
| .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.EndsWith("Messages")) | |
| .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted")); |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <configSections> | |
| <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core"/> | |
| </configSections> | |
| <UnicastBusConfig> | |
| <MessageEndpointMappings> | |
| <add Messages="Messages.Request, Messages" Endpoint="server" /> | |
| </MessageEndpointMappings> |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <configSections> | |
| <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> | |
| </configSections> | |
| <log4net debug="false"> | |
| <appender name="console" type="log4net.Appender.ConsoleAppender"> | |
| <layout type="log4net.Layout.PatternLayout"> | |
| <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n"/> |
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
| var bus = Configure.With() | |
| .DefaultBuilder() | |
| .XmlSerializer() | |
| .MsmqTransport() | |
| .UnicastBus() | |
| .SendOnly(); | |
| bus.Send(new TestMessage()); |
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
| /// <summary> | |
| /// Sends the messages to all sites with matching | |
| /// site keys registered with the gateway. | |
| /// The gateway is assumed to be located at the master node. | |
| /// </summary> | |
| /// <param name="siteKeys"></param> | |
| /// <param name="messages"></param> | |
| /// <returns></returns> | |
| ICallback SendToSites(IEnumerable<string> siteKeys, | |
| params object[] messages); |
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
| public class PlaceOrderHandler : IHandleMessages<PlaceOrder> | |
| { | |
| readonly IDocumentSession session; | |
| public PlaceOrderHandler(IDocumentSession session) | |
| { | |
| this.session = session; | |
| } | |
| public void Handle(PlaceOrder message) |