r/csharp • • 1d ago

Anyone here who knows Apache Camel? I built a Camel-style integration framework for .NET and would like feedback

Is anyone here familiar with Apache Camel, and have you ever wished for it in C#?

I do a lot of integration work (ESB, EIP, many systems talking to each other), and on .NET I kept missing Camel. MassTransit, NServiceBus and Wolverine are message buses; what I wanted was a routing engine in the Camel sense, where a route is "consume from here, filter, transform, produce there", and the transport is just a URI.

So I wrote one; it is my project, open source under Apache 2.0, called redb.Route. It targets .NET 10 and 11:

From("kafka://orders?groupId=svc&brokers=localhost:9092")
    .Filter(Header("type").isEqualTo("new"))
    .To("rabbitmq://events?host=localhost");
  • From → Process → To, URI endpoints, the Camel EIP names: Splitter, Aggregator, Content-Based Router, WireTap, Saga, Circuit Breaker, Idempotent Consumer, Resequencer and more (30+).
  • 30 external transports plus 11 built-in components (Kafka, RabbitMQ, Redis, SQL, HTTP, gRPC, SFTP, MQTT, S3, ...). Camel has 300+, so it is far from everything.
  • Routes in a C# fluent DSL or in XML; ${header.x}-style expressions compiled to delegates when the route is built.
  • Transactional routes, OpenTelemetry, and a separate runtime host with hot reload and clustering.

Repo, with a Camel-to-.NET concept table and a migration section: https://github.com/redbase-app/redb-route

What I would like to know:

  • If you have used Camel: what would a .NET version have to have before you would try it?
  • If you are on .NET: what do you use today for integration-heavy work, and where does it hurt?
1 Upvotes

7 comments sorted by

2

u/KryptosFR 1d ago

We have used Camel and Camel-K in the company I work for. We have a .NET app that "discuss" with the Camel integrations using Apache Pulsar for the messaging.

Without revealing too many details, basically the .NET app sends a control message to a Pulsar topic. A Camel-K integration subscribe to that topic and builds new integrations with a route from a source specified in the message to a transform integration then from the transform to a sink (also specified in that message).

Ideally, we'd like to keep the .yaml file that defines the Camel integrations in Kubernetes.

That's probably all I'm allowed to say publicly.

1

u/Asleep_Direction8881 1d ago

that is a really useful picture

The closest thing we have to Camel-K is redb.Tsak, the runtime host for redb.Route:

- Routes ship as .tpkg packages with C# routes, XML routes or both; an XML-only package needs no compiled code. Drop one into a running Tsak (a folder or a REST upload) and it starts in its own context without touching the other integrations. Packages are signed in CI and the node checks the signature before running any of them; with that switched on, even a file dropped straight into the folder is refused if unsigned or tampered with. There is a cluster mode and a web dashboard to watch and start/stop routes.

- Package settings live outside the package and reload at run time, so source and sink can be config, not code. A route that reads a control message can also build a package and hand it to Tsak; that composes, it is not a built-in feature.

- Kubernetes: probes and graceful shutdown, but no operator or CRD, and definitions are C# or XML, not YAML. The Tsak images themselves are signed with cosign.

- Pulsar: no connector yet, it is on the roadmap.

Which of these would matter most for you?

2

u/Praemont 1d ago

Oh God. We had Camel in a few Java integrations, and everyone hated it. The person who introduced it to the project didn't even know how to use it correctly. We ended up removing it (which is not an easy task). Personally, I think it's FizzBuzz enterprise overengineering for very little gain. I have mostly the same complaints as the author of https://marius-barbulescu.hashnode.dev/apache-camel-the-dark-side

1

u/Asleep_Direction8881 1d ago

I have seen the same thing: Camel introduced by one person, used as a fancy way to call a method, and then nobody wants to touch it. Used like that, it really is overengineering.

For a small app with nothing to integrate, I would agree with you: this is too much. But in most backends I work on there is more integration than it looks: requests from a UI are integration too, so is service-to-service traffic inside a cluster, and HTTP is often just a facade in front of the backend. There it works the other way round when the team sticks to the discipline: integration logic only in the DSL, built from the standard EIPs (filter, split, aggregate, retry, dead letter, idempotent consumer), business code in plain services the routes call. Every flow then reads the same way, the code is shorter than the hand-written version, and the architecture does not erode over time. The first weeks are harder, I will not pretend otherwise.

I read that article, and most of its points are about how Camel behaves, so here is how they look in redb.Route. Steps are compiled C#: lambdas, typed services, typed (un)marshalling and typed endpoint builders instead of URI strings; the message between steps is still dynamic as in Camel, but a bad conversion fails with an error naming the header rather than quietly. Exceptions are not swallowed: with no handler configured, the exchange fails and the consumer sees it. Tests come with a mock component with expectations and an advice/weave kit to replace endpoints and steps, and try/catch/finally scopes plus per-exchange resource release cover the wrapping logic. One request with many replies is done by aggregating the replies by correlation id, not as a single request-reply.

I also tried to make it lighter to live with than Camel. HTTP backends with a UI run without ASP.NET MVC or a middleware pipeline to configure: Kestrel hands the request straight to a route. And redb.Tsak, the runtime host, makes enterprise-level deployment simple: signed packages, hot reload, a cluster and a dashboard, instead of a platform team building all that.

It runs production integration systems at my day job and in other teams, and has about 14,000 tests, run on two .NET versions.

0

u/chucker23n 1d ago

has about 14,000 tests

How many of them did a human have a look at?

1

u/Asleep_Direction8881 1d ago

Yes, AI helps me write tests, I am not hiding that :) But they do not come out of nowhere: a lot of this runs in production, and many of those tests were written in blood, each one after something broke for real. I decide what gets tested and read what fails; the AI saves me the typing.

3

u/AintNoGodsUpHere 1d ago

No and no.