Skip to main content

Particular Software Blog

Latest articles

  • Let's talk about Kafka

    Statue of Franz Kafka in Prague, Czech Replubic
    Head of Franz Kafka, a kinetic sculpture in Prague, Czech Republic

    We get a lot of questions about Kafka. Is it good? Does it live up to the hype? And most frequently, when are we going to support Kafka in NServiceBus.

    But to fully answer these questions, it’s essential to understand what Kafka is, and more importantly what it isn’t, and then think about the kinds of problems that Kafka solves. So, let’s dive into the (heavily footnoted) details…

    Read more

    1. An overloaded term if ever there was one, but that's a subject for another post. Suffice it to say, this does not mean the same thing as an NServiceBus event.

    2. This is a bit of an oversimplification. Ordering in Kafka is only guaranteed per partition, and the number of partitions heavily influences how your topic can scale with the load.

    3. While this may sound like a small detail, it's one of the most important aspects that make technologies like Kafka so popular for data distribution. Guaranteed ordering is one of the fundamental requirements to ensure correct data replication.

    4. That is, assuming that the retention period or maximum size has not been reached, at which point Kafka will start overwriting data. On the other hand, queues will not apply retention settings by default, and if your queue gets full, it will reject further writes until you consume messages from it to free up space. That may sound bad, but it ensures you don't overwrite critical business data.

    5. A NACK or negative acknowledgment

    6. See how NServiceBus retries message processing to determine if a message is a poison message before forwarding it to an error queue in I caught an exception. Now what?

    7. See Error Handling Patterns for Apache Kafka Applications and Kafka Connect Deep Dive – Error Handling and Dead Letter Queues for more information.

    8. …and the folks at Kafka will back us up on this one.

    9. We've seen customers use Azure Event Hubs (which is architecturally similar to Kafka) in this way. They host code in Azure Functions using an EventHubTrigger to monitor event streams, then raise business events in Azure Service Bus (using either a send-only NServiceBus endpoint or native sends) which are processed by NServiceBus endpoints.

  • Simpler configuration in ServiceControl

    The Particular Service Platform is packed full of features that help you monitor your NServiceBus systems. Among other things, it enables you to:

    • manage messages that require a manual retry
    • see when endpoints go offline and back online
    • detect connectivity problems with databases, brokers, and other systems using custom checks
    • troubleshoot message processing performance, both per-message and across an entire flow, using ServiceInsight

    Many of these capabilities have been developed over time as separate plugin packages. Each one has brought its own code-first configuration API. This approach has led to a situation where getting the most from the platform means installing six different NuGet packages and calling seven different configuration APIs.

    We knew we could make it easier. What if it was just one package, and one configuration API?

    Read more
  • More powerful Cosmos DB persistence

    The key to a successful Cosmos DB system is its data partitioning strategy. Like the rows of shrubs in a hedge maze, the logical partitions that divide data must be carefully planned, because that affects the scalability of the system and defines the boundaries for logical transactions.

    In version 1.1 of our CosmosDB persistence package, we’ve made defining the partition key for each message processed by NServiceBus much more straightforward, without needing a custom pipeline behavior. We’ve also added pessimistic concurrency support for more reliable processing of sagas with high contention patterns.

    Read more

    1. Maybe a little too powerful in this case, as there's a risk that the behavior for identifying the Cosmos DB partition could break the outbox feature.

    2. Unless you want to.

    3. For more details, see Optimizations to scatter-gather sagas.

  • Supercharging saga development

    Sagas are one of the most powerful tools available in the NServiceBus toolbox. With a saga, a business process that would otherwise have been implemented as a clunky batch job 1 can be built in a much more elegant and real-time manner.

    We’ve focused on supercharging your ability to develop NServiceBus sagas in our latest round of releases. As a result, you’re going to feel like you’ve got your own “heads-up display” when developing sagas. We’ll give you suggestions and point out problems before you even hit compile. You focus on your business logic.

    Read more

    1. …which we all hate

    2. Squiggly lines? Squigglies? It's hard to know if there's really an official name for these, but this post on C++ getting IntelliSense says squiggles so that's what we're going with.

  • When distributed systems get frustrated

    One of the greatest ever contributions to video games was the invention of the pause button. There are some sequences—those that require absolute perfect timing—where your repeated failure can make you so frustrated you just need to pause, walk away, and try again later until you get it right.

    Read more

    1. It would also be good to be notified that the web service the endpoint depends on is having issues. Check out our sample on how to monitor 3rd-party systems with custom checks to see how this is done.

  • RPC vs. Messaging – which is faster?

    Sometimes developers only care about speed. Ignoring all the other advantages messaging has, they’ll ask us the following question:

    “But isn’t RPC faster than messaging?”

    In place of RPC, 1 they may substitute a different term or technology like REST, microservices, gRPC, WCF, Java RMI, etc. However, no matter the specific word used, the meaning is the same: remote method calls over HTTP. So we’ll just use “RPC” for short.

    Some will claim that any type of RPC communication ends up being faster (meaning it has lower latency) than any equivalent invocation using asynchronous messaging. But the answer isn’t that simple. It’s less of an apples-to-oranges comparison and more like apples-to-orange-sherbet.

    Let’s take a look at the bigger picture.

    Read more

    1. short for remote procedure call

    2. Did you notice we build a product that helps you build message-driven systems? So yeah, maybe we're selling you something too, but at least we're honest about it. 😉

    3. Note: This is not and should not be considered the only definition of microservices.

    4. In NServiceBus, we default to 2 * LogicalProcessorCount, but this is fully configurable.

  • What's new with NServiceBus and Azure Functions

    Do you think Azure Functions are pretty great? Us too! Do you hate boilerplate code? Yeah, us too.

    Have you heard of C# source generators 1 and thought they sounded pretty cool but didn’t really know how they could be useful?

    In the newest version of our Azure Functions integration, we’ve used source generators to reduce the boilerplate needed to set up an NServiceBus endpoint on Azure Service Bus down to just a few lines of code.

    Read more

    1. A source generator is a new type of Roslyn analyzer that runs during compilation, inspects the code you're building, and produces additional source files that are compiled together with the rest of your code. Check out the blog post introducing source generators or the Microsoft source generator docs for more info.

  • Cosmos DB Persistence — Questions & Answers

    We recently released NServiceBus.Persistence.CosmosDB version 1.0, which provides saga and outbox storage for NServiceBus endpoints that is transactionally consistent with the business data you store in Cosmos DB.

    This component was previously offered as a preview package. Now that it has reached version 1.0, our full support policy applies, including API stability and backporting of bugfixes.

    Now that our Cosmos DB persistence has reached general availability, let’s answer some common questions about Cosmos DB and what it means to use Cosmos DB with NServiceBus.

    Read more

    1. For reference, in one year, that's 5 minutes 16 seconds of downtime.

    2. A noisy neighbor problem is where one tenant in a multi-tenant hosting scenario monopolizes too many of the resources such that performance is impacted for the other tenants sharing the same resources.

    3. Data committed to the database but without an accompanying message sent out due to a failure between the database commit and message send operations. See What does idempotence mean? for more details.

    4. A message sent before a failure occurs that can't be recalled, so the message refers to data that never got saved to the database. See What does idempotence mean? for more details.

    5. The two package names are NServiceBus.Persistence.AzureStorage and NServiceBus.Persistence.AzureTable. They're the same thing, we just renamed the package between versions 2 and 3 to make it more clear what it does.

  • More message recoverability options in ServicePulse

    ServicePulse 1.30 is out and this release is all about better recoverability management. We’ve addressed several of our most popular feature requests: add notes to failed message groups restore groups of deleted messages replace lazy loading in message lists with paging export failed message data Read on to take a look at these features in more detail. Read more
  • Cross-platform integration with NServiceBus native message processing

    When the Romans met the Gauls for the first time, they couldn’t talk to each other. The Romans spoke Latin, and Gauls a Celtic language. How could they communicate? It must have been difficult to start with simple gestures, slowly building enough concepts, until a full translation guide was possible. Perhaps one day, as in Star Trek, a universal translator will enable us to talk to anyone regardless of their language, even if chah jatlh Tlhingan. 1

    Sometimes I feel like a Roman meeting a Gaul for the first time. Different technologies make sense to address different problems. For example, if your order entry front end can benefit from rapid prototyping, you should be able to use Ruby on Rails and Active Record. In your back-end system, you might benefit from event-driven architecture, automatic message retries, and orchestration of long-running business processes. In that case, you should be able to use C#, RabbitMQ, and a messaging framework like NServiceBus.

    But then, how do we get these parts to communicate and work together?

    Read more

    1. they speak Klingon

    2. Technically, IronRuby does exist for this, but……

    3. Raise your hand if you've ever had a problem where your JSON serializer wouldn't talk to somebody else's JSON serializer. 🙋

    4. An endpoint is just a short name for a logical message processor.

    5. Plain Old C# Object

Need help getting started?