Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Szymon Pobiega SzymonPobiega

🏠
Working from home
View GitHub Profile
View header-mutation-between-retries.cs
using System;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Logging;
using NServiceBus.MessageMutator;
namespace RabbitMutatorTest
{
class Program
{
View sql-transport-deadlock.cs
using System;
using System.Threading;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Satellites;
using NServiceBus.Transports;
using NServiceBus.Transports.SQLServer;
using NServiceBus.Unicast;
using NServiceBus.Unicast.Transport;
View SeparateConnections.cs
using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Persistence.Sql;
class Program
{
static void Main(string[] args)
View MultiTenantSagas.cs
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Features;
using NServiceBus.Pipeline;
using NServiceBus.Sagas;
class Program
View Repro.cs
using System;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Persistence;
namespace Backend
{
class Program
{
static void Main(string[] args)
View enable-router.cs
var routerConfiguation = new RouterConfiguration("Router");
routerConfiguation.AddInterface<MsmqTransport>("MSMQ", t => {}).DisableMessageDrivenPublishSubscribe();
routerConfiguation.AddInterface<SqlServerTransport>("SQL", t => t.ConnectionString(myConnectionString)).DisableMessageDrivenPublishSubscribe();
routerConfiguation.Chains.AddRule(c => new MetricsPreroutingTerminator("MSMQ", "Particular.Monitoring@some-machine"));
routerConfiguation.UseStaticRoutingProtocol();
var router = Router.Create(routerConfiguation);
await router.Start().ConfigureAwait(false);
View polymorphic-collections.cs
namespace NServiceBus.AcceptanceTests.Sagas
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EndpointTemplates;
using AcceptanceTesting;
using global::NHibernate.Cfg;
using global::NHibernate.Dialect;
@SzymonPobiega
SzymonPobiega / sendlocal.cs
Created Jul 31, 2019
Testing auditing of SendLocal-sent messages
View sendlocal.cs
using System;
using System.Threading.Tasks;
using NServiceBus;
namespace AuditSendLocalTest
{
class Program
{
static void Main(string[] args)
{
View TransactionLeak.cs
using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using System.Transactions;
using NServiceBus;
namespace ConnectionLeakTest
{
class Program
{
@SzymonPobiega
SzymonPobiega / nsb_raw_hacks.md
Created Mar 10, 2020
Hacks in NServiceBus.Raw
View nsb_raw_hacks.md

Stuff passed via settings

Things that transport used to require that are passed via settings, not via seam:

Settings.Set("Endpoint.SendOnly", sendOnly);
Settings.Set("TypesToScan", new Type[0]);
Settings.Set("NServiceBus.Routing.EndpointName", endpointName);
Settings.Set<Conventions>(new Conventions()); //Hack for ASB
Settings.Set<StartupDiagnosticEntries>(new StartupDiagnosticEntries());