Author Archive Mogens

ByMogens

GitHub stars

Rebus has reached 1000 stars on GitHub. ๐Ÿค 

It may seem like an odd thing to notice, but I couldn’t help getting all warm and fuzzy inside! In my view, that silly little number, albeit primitive and one-dimensional, is a clear indication of a something pretty important: Street credibility among programmers.

Even though Rebus started out as a selfish project, in the sense that I needed a handy messaging library that didn’t have licensing obstacles in the way of delivering great software to consulting clients, it has grown to be so much more.

Many thanks to the almost 100 contributors besides me, who have contributed with their time and intellect to build Rebus and around 50 integration libraries.

Much โค๏ธ.

ByMogens

Generic host

Over the years, people have often asked me if Rebus had a “generic host”, similar to NServiceBus’ Generic Host. In case you don’t know, NServiceBus’ generic host is a library that helps you easily get an NServiceBus endpoint up and running as a Windows Service.

Rebus doesn’t have a generic host though โ€“ and there’s a good reason for that! ๐Ÿ™‚

The reason is, that there’s no reason why the Windows Service host should in any way be Rebus-specific!

What you really want in a Windows Service host (and in any host, really) is just a simple model for initializing something, keeping it around for the duration of the program’s lifetime, with proper termination at the end.

The cool thing is that .NET has great built-in mechanisms for initializing and terminating things โ€“ they’re called CONSTRUCTORS and IDisposable!

So what if a Windows Service could be composed of something, that should simply be newed up and disposed afterwards? And what if the hosting library made it possible to also run the app as an Azure Web Job? And what if it could host any number of “things”?

That’s what Topper does! ๐Ÿ˜Ž

Topper is built on Topshelf, so that means F5-debugging as a Console Application, and the ability to be installed as a Windows Service.

In addition to this, Topper will detect if it’s running as an Azure Web Job and do what’s necessary to shut down cleanly.

This is what your program can look like with Topper:

class Program
{
    static void Main()
    {
        var configuration = new ServiceConfiguration()
            .Add("first", () => new MyFirstService())
            .Add("second", () => new MySecondService());

        ServiceHost.Run(configuration);                
    }
}

ServiceConfiguration allows for adding any number of named factories, each returning an IDisposable, and async factories (Func<Task<IDisposable>>) are supported, too.

As you can see, there’s no good reason why a “generic host” should be tied to any particular service bus library…ย so that’s why Rebus does not have a generic host. ๐Ÿค“

ByMogens

MongoDB database migration

When you’re developing a fairly large application, and you design things properly, you will almost inevitably end up distilling out some nice things into independent, well-factored libraries โ€“ because, Separation of Concerns, you know… ๐Ÿค“

That also happened this Friday, when Fleet Manager got its evolutionary database design library for MongoDB moved out into its own project: Mongrow.

With Mongrow, you can write database migrations as C# classes and have them executed in a safe, consistent, and deterministic manner, probably when your application starts up.

Its design is very much inspired by migr8, another little database migration library, only made for MSSQL and Postgres.

So… if you’re using MongoDB in .NET, you might want to check it out: The binaries are on NuGet.org.

ByMogens

We have a mailing list

If you’re interested in receiving weekly emails with little nuggets of Rebus wisdom, go here and sign up! ๐Ÿ’Œ

ByMogens

Meet Afonso

Hi everyone, meet Afonso!

Having finished a secondary school professional programme within Computing, he came to Denmark two years ago from his home island of Madeira in Portugal, to pursue an AP degree in IT Technology at Dania Academy in Viborg. ๐ŸŽ“

Afonso has now moved to Horsens to do his final internship here at Rebus FM, where he will spend most of his time performing a security review of Fleet Manager. ๐ŸšŒ

In addition to this, it’s already quite clear that he will inspire Alley 87‘s residents to extend #skalerbar‘s assortment of beverages into the territory of fortified wines, which we’re looking forward to. ๐Ÿท

ByMogens

MongolianBarbecue is out as 1.0.0

It’s a nifty little tool with a silly label, but since it implements queues on top of MongoDB, the name was inevitable! ๐Ÿค 

So, if all you have in the world is MongoDB, and you want to do some messaging, you can do this:

var config = new Config("mongodb://MONGOBONGO01/some-db", "messages");

to create a configuration, and then you

var producer = config.CreateProducer();
var message = new Message(Encoding.UTF8.GetBytes("hei"));

await producer.SendAsync("destination-queue", message);

to send a UTF8-encoded text to a queue named destination-queue, and then you

var consumer = config.CreateConsumer("destination-queue");

var message = await consumer.GetNextAsync();

// ... handle message here

to receive the message and handle it.

You can read more about it on the GitHub page, and you can get the binaries from your favorite package repository.

Read More

ByMogens

Tababular 3 is out

Nothing happened, really, since announcing the beta, so this is just a little public service announcement to tell you that Tababular is out now as version 3! ๐Ÿ™‚

“What’s tababambabular?”, you might ask?

It’s just a little nifty library that can format data as tables, which is a nice thing to do sometimes.

E.g. in automated tests, instead of outputting one manually formatted crappy-looking test output after another, why not just collect the data and print it as a table? Here’s an example from the Fleet Manager’s driver, where emitted saga snapshot states are presented in a nice, readable summary form:

+-----------+--------------------------------------+
| Revisions | SagaId                               |
+-----------+--------------------------------------+
| 0         | 42d9beb5-d94c-4f62-9c60-65beb40c9b5e |
| 1         |                                      |
| 2         |                                      |
| 3         |                                      |
+-----------+--------------------------------------+
| 0         | 1c4c3db0-9ac2-4541-9752-ed01719aa217 |
| 1         |                                      |
| 2         |                                      |
| 3         |                                      |
| 4         |                                      |
| 5         |                                      |
| 6         |                                      |
| 7         |                                      |
+-----------+--------------------------------------+

Or how about CLI applications? Check out how Fleet Manager’s administration CLI presents the list of accounts in our DEV environment:

Happy formatting! ๐Ÿ“œ

ByMogens

Rebus 5 is out

Lots of small changes, only a few of them breaking(*), nothing earth-shattering ๐Ÿ™‚

The biggest change is probably that the test helpers (FakeBus, SagaFixture, etc.) were moved to a separate repository and its own NuGet package: Rebus.TestHelpers.

Another slightly bigger change is that Rebus now targets .NET 4.5, .NET 4.6, and .NET Standard 2.0. If anyone is missing the .NET Standard 1.3. support, please โœ‰๏ธโžก๏ธ[email protected] and let us know why ๐Ÿ‘ป

Some of the smaller changes include a few performance improvements ๐Ÿ’จ, an extension point to customize how topic names are created out of .NET types, the ability to “fail fast” (i.e. skip retries) in various situations ๐Ÿ’ฅ, and a way to delay message processing when starting up the bus.

As usual, WIRE-COMPATIBILITY is 100% with all versions of Rebus from 2 and up, so you don’t need to go all-in to start upgrading your endpoints! ๐Ÿ˜‡

See the full 5.0.0 changelog entry for more details on what was changed.


(*) In theory, all changes can be breaking… in this case, the version was bumped to 5 primarily because the IRoutingApi interface was extended with the Defer method signature, and because all of the testing helpers were moved.

ByMogens

Support for Microsoft Extensions Logging

If you’re running your Rebus stuff on .NET Core, and you’re using “Microsoft Extensions Logging” (that’s just not a bite-sized title for a logging library), you’re in luck: Rebus now has Rebus.Microsoft.Extensions.Logging, so you can

var loggerFactory = new LoggerFactory()
	.AddYourSinksHere();

Configure.With(...)
	.Logging(l => l.MicrosoftExtensionsLogging(loggerFactory))
	.Transport(t => t.Use(...))
	.(...)
	.Start();

and have Rebus log its stuff there, too.

The package is currently in alpha, but since there’s not much to it, we expect it to be pretty stable.

Happy logging! ๐Ÿค 

ByMogens

Rebus’ Azure Service Bus transport now supports .NET Core

For almost a year, this GitHub issue has been open โ€“ย but I’m happy to announce that I’ve closed it just now, which I’ve done of course because Rebus’ Azure Service Bus transport has now finally been ported properly to Microsoft’s new Azure Service Bus driver.

When the new driver came out, lots of people were puzzled, because it lacked the management operations from the original driver. This meant that queue creation, topic creation, and even mundane stuff like subscribing to topics, could not be done with it.

It took a long time and some pretty dedicated community work for the driver to come out with management operations in it, which happened about two months ago (as a prerelease, stable version was out one month ago).

Today, all of our Fleet Manager environments have been running with Rebus’ new Azure Service Bus transport a week or more, so we’re ready to let Rebus.AzureServiceBus 6.0.0 out into the wild ๐Ÿฆ๐ŸŒณwhich in turn means that Rebus can use Azure Service Bus on the .NET Core 2.0/.NET 4.6.1 and later runtimes.