<logger name="NServiceBus.LicenseManager" additivity="false">
<level value="OFF" />
</logger>
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
// | |
// Based on https://stackoverflow.com/a/5641272/199551 | |
// | |
public class NaturalComparer : IComparer<string> | |
{ | |
public static readonly NaturalComparer Instance = new NaturalComparer(); | |
private NaturalComparer() { } | |
public int Compare(string x, string y) |
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
// | |
// Usage: | |
// | |
// var endpointConfiguration = new EndpointConfiguration("MyEndpoint") | |
// ... | |
// endpointConfiguration.Pipeline.Register(new CheckSizeBehavior(CheckSizeBehavior.StandardTierMaxSize), nameof(CheckSizeBehavior)); | |
// | |
using NServiceBus.Pipeline; | |
class CheckSizeBehavior : IBehavior<IOutgoingPhysicalMessageContext, IOutgoingPhysicalMessageContext> |
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
// Usage: | |
// | |
// var endpointConfiguration = new EndpointConfiguration("MyEndpoint") | |
// ... | |
// var connectionString = Environment.GetEnvironmentVariable("AzureServiceBus_ConnectionString"); | |
// var managementClient = new ManagementClient(connectionString); | |
// endpointConfiguration.Pipeline.Register(new ValidateDestinationExistsBehavior (managementClient), nameof(ValidateDestinationExistsBehavior)); | |
// | |
using Microsoft.Azure.ServiceBus.Management; | |
using NServiceBus.Pipeline; |
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; | |
using System.Linq; | |
using Serilog.Core; | |
using Serilog.Events; | |
class ExceptionEnricher : ILogEventEnricher | |
{ | |
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) | |
{ |
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.Globalization; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.Extensions.Logging; | |
using MQTTnet; | |
class DsmrTeslaLoadBalancer |
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
static class TransactionManagerHelper | |
{ | |
public static void ConfigureTransactionTimeout(TimeSpan timeout) | |
{ | |
#if NETFRAMEWORK | |
SetTransactionManagerField("_cachedMaxTimeout", true); | |
SetTransactionManagerField("_maximumTimeout", timeout); | |
#else | |
SetTransactionManagerField("s_cachedMaxTimeout", true); | |
SetTransactionManagerField("s_maximumTimeout", timeout); |
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
static class ListExtensions | |
{ | |
static Random rng = new Random(); | |
public static void Shuffle<T>(this IList<T> list) | |
{ | |
// From https://stackoverflow.com/a/1262619/199551 but refactored via Resharper | |
int n = list.Count; | |
while (n > 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
class MySaga : Saga<MySagaData>, | |
IAmStartedByMessages<MessageA>, | |
IAmStartedByMessages<MessageB> | |
IHandleMessages<CompleteMySaga> | |
{ | |
public Task Handle(MessageA message, IMessageHandlerContext context) | |
{ | |
Data.A = true; | |
await Check(context); | |
} |
To enable ServiceControl email notifications via scripting it is required to send
- [Configure] POST to
http://localhost:33333/api/notifications/email
withContent-Type: application/json
and body like: - [Enable] POST to
http://localhost:33333/api/notifications/email/toggle
withContent-Type: application/json
and body like:
Configure body:
{
"smtp_server" : "localhost",
"smtp_port" : "25",