For those interested. Here are some more resources: Background:
https://camel.apache.org/blog/2022/01/dynamic-router-eip-component/ Documentation: https://camel.apache.org/components/3.18.x/dynamic-router-component.html ------------------- For me, reading through the documentation, it seems like a powerful component. However, there are some things I am failing to grasp: 1. What are the use cases this can be used for. And with kind of use cases I mean business use cases explained in simple terms for end-users. 2. As I understand it, the dynamic router provides 'topics' similar to Kafka topics or JMS topics, but then build into Camel. Is this correct? 3. In the documentation examples I see a lot of plain Java code. Things like unsubscribing: // Send message to the Dynamic Router "billing" channel// to unsubscribe from billing messagesDynamicRouterControlMessage unsubscribeMsg = new UnsubscribeMessageBuilder() .id("billingSubscription") .channel("billing") .build(); template.sendBody("dynamic-router:control", unsubscribeMsg); I try to use the Route DSL's as much as possible. (especially XML and YAML, because they are easily to manipulate). How can I use the component within regular routes without things like Predicates and other Java code? Kind regards, Raymond On Sat, Nov 5, 2022 at 4:06 PM Steve973 <steve...@gmail.com> wrote: > Hello. I introduced a Dynamic Router EIP component in 3.15 because I had > uses for a dynamic router that was a bit different than what the core > component offers. I would like some feedback about what features to > potentially add that would make it even more useful. First, just in case > you are not familiar with its capabilities, I will describe how I am using > it in a software system that I am building at work, which exercises it > fairly well. We have a little fewer than 10 spring boot modules that > handle specific tasks of the system. One of the modules is a "routing > engine" that is mostly a wrapper for Camel, along with some > business-logic-specific integration code. This is where I instantiate the > Dynamic Router component, and create a JMS route that can feed it > subscriber messages. The other modules register their subscriptions with > the dynamic router by sending messages over JMS to the router. These > messages contain a predicate that allows the dynamic router to evaluate > messages that pass through it to determine one, or more, recipients. With > their subscription messages, they also include a destination URI for > applicable messages to be routed to. This allows for a somewhat advanced > version of the command pattern in my system. > > Can any of you think of what this is missing? My first implementation used > a list for keeping track of subscribers, but that allowed a module to > register its commands multiple times. So, that has been changed to a map > that maps by subscriber ID. The other thing, and I have not developed a > solution for this, but in the event of an error, the "routing table" of > routes and endpoints is not available that I know of. I am not sure how to > handle that, or if there is something built into Camel that might > facilitate that type of tracing/debugging information, of it I might need > to keep track of it in a table within the component. > > Anyway, this is already long enough, and I don't want to bore you with too > many details. If you have time, please provide some feedback, and I will > get more features into the Dynamic Router EIP. > > Thanks, > Steve >