Hi Camel has no limitations on the number of routes per context. However you should have 1 camel context per "app" (deployment unit), so they have the same lifecycle etc. So a rule of thumb is to have routes that belong together, and share same lifecycle / change together in your app.
So if your app has 100 routes then that is fine. Just mind starting up and shutting down 100 routes may take a little time. In container world then 1 route per container is surely overkill, as jvm overhead is still signifcant. Well camel-quarkus will help a lot on this when you can AOT compile to native, but there are still some way to go for 3rd party to fully support this and the graalvm project itself. On Fri, Sep 27, 2019 at 9:14 PM Ron Cecchini <[email protected]> wrote: > > TL;DR: 1 CamelContext with 100 Routes vs. 100 CamelContexts each with 1 Route > > Say I need to ingest data from a hundred sensors or data sources, over TCP or > JMS, and get it written to a central database or JMS. > > The messages are asynchronous and don't require a response or any processing. > We just have to suck in all that data and write it out to a DB or JMS. > > It would be really nice to keep these 100 very simple routes in a single > config / RouteBuilder. But that's not the smart thing to do... By the time > you reach a 100 routes you'd probably need an app server and access to a > cluster. But I don't think spinning up a new CamelContext / app for 100 > single Routes is the way to go either. Or maybe it is? Maybe you > containerize every single Route with Docker and manage it with Kubernetes (or > whatever)? > > I guess I'm just looking to see if anyone has experimented with this and did > some performance comparisons - like, how many Routes were you able to cram > into your CamelContext / Spring Boot app before it started degrading? And > how folks managed a scenario like this where they had to pull in data from > many sources. > > If you don't have a cluster, and have to keep everything on a single beefy > host, I guess the question is moot and you have to do as much as you can in > one CamelContext until you hit a scalability limit... > > Thanks and have a good weekend. > > Ron -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
