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.Data; | |
using System.Diagnostics; | |
using NServiceBus; | |
using NServiceBus.Persistence.NHibernate; | |
using NServiceBus.Pipeline; | |
using NServiceBus.Pipeline.Contexts; | |
class MyContextBehaviorRegistration : INeedInitialization | |
{ |
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
busConfiguration.RegisterComponents(r => r.ConfigureComponent<ReceiverDataContext>(DependencyLifecycle.InstancePerUnitOfWork)); | |
busConfiguration.RegisterComponents(r => r.ConfigureComponent<IDbConnection>(b => b.Build<NHibernateStorageContext>().Connection, DependencyLifecycle.InstancePerUnitOfWork)); | |
class DbContextUnitOfWork : IManageUnitsOfWork | |
{ | |
private readonly Func<ReceiverDataContext> createContext; | |
public DbContextUnitOfWork(Func<ReceiverDataContext> createContext) | |
{ |
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
[void] [Reflection.Assembly]::LoadWithPartialName("System.Messaging") | |
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("LOCALHOST") | % { $_.Purge(); } | |
echo "All MSMQ queues purged" | |
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("LOCALHOST") | ForEach-Object { | |
$queueFormatName = "$($_.Path);JOURNAL" | |
#Write-Host $queueFormatName -foregroundcolor cyan |
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 NServiceBus; | |
using NServiceBus.Logging; | |
class ThrottleThroughputWhenCheckFailsUsingScheduler : IWantToRunWhenBusStartsAndStops | |
{ | |
NServiceBus.Unicast.UnicastBus bus; | |
Schedule schedule; | |
ILog Log = LogManager.GetLogger(typeof(CheckBreaker)); |
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 NServiceBus; | |
using NServiceBus.Logging; | |
using ServiceControl.Plugin.CustomChecks; | |
class ThrottleThroughputWhenCheckFails : PeriodicCheck | |
{ | |
NServiceBus.Unicast.UnicastBus bus; | |
ILog Log = LogManager.GetLogger(typeof(IntegrationCustomCheck)); |
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.Collections.Generic; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
using System.Web.UI; | |
namespace StringExtensions | |
{ | |
/// <remarks> | |
/// http://james.newtonking.com/archive/2008/03/27/formatwith-string-format-extension-method.aspx |
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 NServiceBus; | |
using NServiceBus.Hosting.Profiles; | |
using NServiceBus.Log4Net; | |
using NServiceBus.Logging; | |
public class EndpointConfig : IConfigureThisEndpoint | |
{ | |
public EndpointConfig() | |
{ |
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
// | |
// Run this before anything NServiceBus related. If using | |
// the host, put this in the constructor of the endpoint | |
// configuration class. | |
// | |
log4net.Config.XmlConfigurator.Configure(); | |
NServiceBus.Logging.LogManager.Use<NServiceBus.Log4Net.Log4NetFactory>(); |
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.Globalization; | |
using log4net.Util; | |
namespace log4net | |
{ | |
public static class LogExtentions | |
{ | |
private static readonly Type ThisDeclaringType = typeof(LogExtentions); |
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"?> | |
<log4net> | |
<!-- Buffer 128 entries except with log level severity is WARN or higher. --> | |
<appender name="buffer" type="log4net.Appender.BufferingForwardingAppender"> | |
<bufferSize value="128" /> | |
<appender-ref ref="console" /> | |
<!--<lossy value="false" />--> | |
<!--<OnlyFixPartialEventData value="true"/>--> | |
<evaluator type="log4net.Core.LevelEvaluator"> |
OlderNewer