Skip to content

Instantly share code, notes, and snippets.

View SzymonPobiega's full-sized avatar
🏠
Working from home

Szymon Pobiega SzymonPobiega

🏠
Working from home
View GitHub Profile
Hi!
We are working on updating ServiceControl to RavenDB version 5.*.
One of the technical requirements of RavenDB 5.0 is that the machine has .NET Core 3.1 installed.
We cannot shift the ServiceControl executable to have a dependency on .NET Core 3.1 as it sill depends on Windows Services and the Event Log. In addition to that, ServiceControl Management is a desktop WPF application that cannot be ported to .NET Core 3.1 anyway.
To cope with all this we intended to add .NET Core 3.1 as a prerequisite to the ServiceControl installer (.NET 4.6.2 is already a pre-requisite).
However, during the update process, RavenDB version 5.1 was released. This version has many needed bug-fixes, as well as a feature (document compression) that is quite useful for useful. **RavenDB 5.1 has shifted from .NET Core 3.1 to .NET 5**. As a result, we will switch to **requiring .NET 5** as a dependency in our installer. This should still be transparent to users of our installer package. We expect that fixes for bugs found in futu
function Rename-ServiceControl($instanceName, $newInstanceName) {
#Derive the current bin and data paths from the instance names
$binPath = "${Env:ProgramFiles(x86)}\Particular Software\$instanceName"
$dataPath = "${Env:ProgramData}\Particular\ServiceControl\$instanceName"
#Derive the new bin and data paths from the instance names
$newBinPath = "${Env:ProgramFiles(x86)}\Particular Software\$newInstanceName"
$newDataPath = "${Env:ProgramData}\Particular\ServiceControl\$newInstanceName"
@SzymonPobiega
SzymonPobiega / raw-processing.cs
Created March 13, 2020 11:19
Raw message processing using plain NServiceBus
using System;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Extensibility;
using NServiceBus.Pipeline;
using NServiceBus.Routing;
using NServiceBus.Transport;
namespace TestRawProcessing
{
@SzymonPobiega
SzymonPobiega / nsb_raw_hacks.md
Created March 10, 2020 07:26
Hacks in NServiceBus.Raw

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(new StartupDiagnosticEntries());
using System;
using System.Data.SqlClient;
using System.Threading.Tasks;
using System.Transactions;
using NServiceBus;
namespace ConnectionLeakTest
{
class Program
{
@SzymonPobiega
SzymonPobiega / sendlocal.cs
Created July 31, 2019 12:11
Testing auditing of SendLocal-sent messages
using System;
using System.Threading.Tasks;
using NServiceBus;
namespace AuditSendLocalTest
{
class Program
{
static void Main(string[] args)
{
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;
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);
using System;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Persistence;
namespace Backend
{
class Program
{
static void Main(string[] args)
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