Commerce Mind Nexus

Commerce Mind Nexus is a .NET (6+) based library and solution from Commerce Mind for running scheduled background functions and jobs, and populating and processing queues of messages. The solution is built primarily with e-commerce data flows in mind but it's a general solution that works outside of e-commerce as well.

Key features

  • Distributed as NuGet packages, Apache 2.0 licensed
  • Over 600 integration and unit tests to ensure stability
  • Execute a class method with retries in the background using Nexus functions
  • Schedule jobs to run every X seconds/minutes/hours/etc
  • Out-of-schedule job runs
  • Scale out and run jobs and functions on multiple servers
  • SQL based queues with repository like access
  • In-memory queues with fallback storage when performance requires it
  • Versioned queue messages with optional identity to ensure safety
  • Access to previous version of messages to enable sophisticated change tracking
  • Virtual queues with one or more backing queues
  • Processing queue messages in batch or one by one
  • Full HTTP API and Admin UI
  • Enqueue over HTTP API to let other services create messages
  • Great introspection, debuggability, and visibility into the contents of the queues
  • Easily re-enqueue failed messages
  • Monitoring of failed jobs, queue messages, and functions
  • Custom statuses for queue messages to allow grouping and saving for later
  • Enqueueing messages for processing in the future
  • Optionally keep processed messages
  • Retry processing a queue message in X minutes
  • Scheduled health checks
  • Can easily be embedded into an existing application
  • No external dependencies required, everything can be run locally on a dev machine
  • Metrics exposed with Open Telemetry
  • Out-of-the-box integrations with Azure, Teams, Slack, and RabbitMQ

See the section about Nexus vs FaaS if you read this and thought "Well I already have Azure Functions for this".

If you've used Hangfire before you might want to read the Hangfire vs Nexus comparison.

Demo environment

There's a demo environment that's deployed to a free tier Azure Web App here:

Admin UI
https://commerce-mind-nexus.azurewebsites.net/admin/

API
https://commerce-mind-nexus.azurewebsites.net/swagger/

You can click on any buttons you like, start any job or function or do anything with the queues to get a feel for what the system does.

Demo environment

Since the demo environment is using a free tier Azure Web App the scheduler is paused when nobody is using the API or admin UI which means that the jobs won't run exactly according to schedule.

Getting started

The first thing you need to do is to get access to the NuGet packages which are hosted on a Github packages. Just talk to us and we'll add you to the repo and give you access to the NuGet feed!

Once you've gotten a Personal Access Token for the feed you need to configure NuGet to look for packages in this feed:
https://nuget.pkg.github.com/Commerce-Mind/index.json

You use your Github username as username and the Personal Access Token as password. Read more about the Github NuGet feed here:
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry

When you have access you need to install these NuGet packages in a .NET Core (6 or later) project:

CommerceMind.Nexus

# One or more of:
CommerceMind.Nexus.Postgres
CommerceMind.Nexus.SqlServer
CommerceMind.Nexus.Sqlite

This package is for the API and admin UI which is only relevant if you're using ASP.NET.

CommerceMind.Nexus.Api

When you've installed the packages you open your Program.cs and add this initialization code:

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddSingleton<ExampleService>();
builder.Services.AddControllers();

builder.Services
    .AddNexus()
    .AddSingleServerInstanceEvents()
    .AddFunctions()
    .AddScheduledJobs()
    .AddQueues()
    .AddApi()

    .AddSqliteConnection()
    // Or:
    // .AddPostgresConnection()
    // .AddSqlServerConnection()

    // Don't forget to call this, as this is what finializes the Nexus registration and validates it!
    .Build()
;

var app = builder.Build();

// If you want the admin UI
app.UseNexusAdminUI();

app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();

Now let's create the most simple functions, jobs and queues possible, make sure to place it in the same .NET project as your Program.cs file.

public class ExampleService
{
    public void ExampleMethod(int arg)
    {
        Console.WriteLine("ExampleMethod was called with arg: " + arg);
    }
}

public class ExampleJob : IScheduledJob
{
    private readonly IEnqueuer<ExampleQueueMessage> _enqueuer;
    private readonly INexusFunction _nexusFunction;

    public ExampleJob(IEnqueuer<ExampleQueueMessage> enqueuer, INexusFunction nexusFunction)
    {
        _enqueuer = enqueuer;
        _nexusFunction = nexusFunction;
    }

    public string DefaultSchedule => CronSchedule.TimesPerMinute(10);

    public async Task<JobResults> ExecuteAsync(CancellationToken cancellationToken)
    {
        await _enqueuer.EnqueueAsync(new ExampleQueueMessage());
        await _nexusFunction.RunInBackgroundAsync<ExampleService>(x => x.ExampleMethod(123));
        return JobResults.Completed("This went great!");
    }
}

public class ExampleQueueMessage : IQueueMessage
{

}

public class ExampleQueueProcessingJob : IScheduledQueueJob<ExampleQueueMessage>
{
    public string DefaultSchedule => CronSchedule.TimesPerMinute(10);

    public async Task<ProcessResults> ProcessMessageAsync(ExampleQueueMessage message, CancellationToken cancellationToken)
    {
        return ProcessResults.Completed("The message was processed!");
    }
}

Place a breakpoint in the ExampleMethod(), ExecuteAsync() and ProcessMessageAsync() methods and start the application. The breakpoints should get hit within a couple of seconds. Now we have a very basic example of one job scheduling a function as well as producing messages and placing them in a queue, and another job that process the messages.

If using a web application you'll also be able to access the API on eg /api/jobs and /api/jobs/ExampleJob/historical-runs. And the admin UI is available on /admin. With the above setup you're using SQLite as the database which is great for quickly getting started, but it's not really fit for a heavy production load. Read more about database setup in the database section.

When you've got the above working you should dig deeper into the docs here to understand everything you can do with the system!

Trusted by

Nexus is used in production by some of the Nordic region's most well-known e-commerce companies.

Lyko

Lyko is a leading Nordic beauty and hair care retailer operating across Sweden, Norway, Finland, and several other European markets. With a complex, constantly evolving IT environment spanning multiple group companies, Lyko manages B2C flows through third-party logistics providers using a custom-built Order Management System. Nexus is integrated directly into that OMS, giving developers immediate visibility into logs and making it easy to pinpoint and resolve problems across a distributed infrastructure. The flexible adapter concept makes it straightforward to add new integrations rapidly as Lyko expands into new markets and channels.
"The adapter concept provides flexible support and enables quick implementation of new integrations with high visibility out of the box."
— Peter Gunnarsson, CTO Lyko

Cervera

Cervera is one of Sweden's most established kitchenware and home decor retailers, currently undergoing a major IT transformation — relocating their IT environment, replacing their ERP, and reworking the integrations that connect it all. Through Nexus, Cervera has unified their order flows across ERP, billing, purchasing, and analytical systems into a single, well-monitored integration layer. A key outcome has been shifting day-to-day monitoring from the technical team to business personnel, with live health check dashboards displayed on office screens. This gives the whole organisation fast, clear visibility into whether integrations are running as expected — and makes it easy to respond when they are not.
"Commerce Mind Nexus is a stable product that works well handling our integrations. What stands out is the visual overview and the ability to easily receive alerts about problems and rerun jobs with a single click."
— Rasmus Andersson, CTO Cervera

Kjell & Company

Kjell & Company is Sweden's leading specialist retailer in consumer electronics, cables, and accessories, with more than 80 stores across the Nordic region alongside a growing e-commerce presence. Running an omnichannel operation means keeping a large number of systems — storefronts, warehouse management, ERP, and supplier feeds — continuously in sync. Nexus handles the background job orchestration and queue processing that keeps order and inventory data flowing reliably between those systems, both in real time and on schedule. The monitoring capabilities help the development team surface and fix integration issues quickly, before they reach customers.

Thule

Thule is a globally recognised Swedish brand specialising in outdoor lifestyle products — roof racks, bike carriers, bags, and luggage — sold in more than 100 countries. Running e-commerce operations at global scale demands tight, dependable integration between online storefronts, ERP systems, and an international network of logistics partners. Nexus manages the scheduled background jobs and queue processing that keep orders, product data, and fulfilment information flowing accurately across Thule's digital infrastructure. The solution's stability and built-in observability are a natural fit for a company where reliability is non-negotiable.

Lekia

Lekia is one of Sweden's most beloved toy retail chains, with stores across the country offering a wide range of toys, games, and children's products. Behind the scenes, keeping stock, orders, and supplier data in sync across both physical and digital channels requires a robust integration layer. Nexus manages the background job processing and queue handling that ensures Lekia's order flows run reliably, whatever the volume. The health check and monitoring features give the team confidence that everything is working as it should — and a clear path to action when something needs attention.

Nordic Nest

Nordic Nest is one of Europe's leading online destinations for Scandinavian design, founded in 2002 and offering more than 250 curated brands — from iconic names like Georg Jensen and Marimekko to contemporary favourites like Ferm Living and Normann Copenhagen. Operating across multiple European markets with worldwide shipping, Nordic Nest has built a reputation not only for their exceptional product selection but for staying at the forefront of e-commerce technology. Their engineering team embraces modern tooling and infrastructure to deliver a seamless shopping experience at scale, making them one of the most technically ambitious retailers in the Nordics. Nexus fits naturally into that culture — providing reliable, observable background processing that keeps their order and data flows running without friction.

Ark

Ark is Norway's largest bookstore chain, with more than 150 stores across the country alongside a thriving e-commerce platform at ark.no and a dedicated reading app for digital books. Owned by Gyldendal ASA, Ark has built one of the most ambitious omnichannel retail operations in Scandinavia, seamlessly connecting physical stores, online orders, and click-and-collect services for millions of customers. The scale of their operations — handling millions of book titles and a high volume of daily orders across every channel — demands an integration layer that is both robust and highly observable. Nexus provides the background job orchestration and queue processing that keeps Ark's order flows, inventory data, and system integrations running reliably across their entire operation.

Hatstore

Hatstore is a Swedish e-commerce company founded in 2011 and today one of Europe's leading online retailers for headwear, with over 20,000 caps, hats, and beanies from more than 100 brands including New Era, '47, and Mitchell & Ness. Operating regional webshops across more than ten European markets — including Sweden, Germany, the UK, France, Spain, and the Netherlands — Hatstore manages a complex multi-market setup with localised storefronts and a shared logistics infrastructure. Beyond off-the-shelf products, Hatstore also offers a custom design service with embroidery and printing, adding another layer of operational complexity to their order flows. Nexus helps keep those flows — across markets, product types, and fulfilment paths — running smoothly with full visibility into what is happening at every step.