Architecting multi queue / multi topic subscriber component

Hi Ali, that’s quite a bundle of stuff to manage, I think it’ll be necessary to break it down into smaller chunks to work through. A couple things to clarify upfront:

  • If you have multiple queues, each queue would get it’s own msg-handler function per flow, so you would effectively get per-Queue dispatching if that aligns to your patterns
  • TopicDispatch is not supported in the native Java JCSMP library, but it is supported in the Java-RTO (RealTime Optimized) library; not suggesting that for general-compute use cases, it is designed for very low-latency, high-performance apps and supports a Zero-GC model for those that want that
  • I wouldn’t normally recommend a separate session per msg-handler as a rule of thumb but if you don’t have a lot of connections and are not risking hitting your connection-limits, it would be a benign way to achieve what you are looking for.

May I ask what is your main motivation for wanting different message-handlers per destination? Is it because of the data types of the messages arriving on those topics? Or is it something about controlling the handler context for each topic or flow? Depending on those reasons, my recommendations would vary.

Cheers,
kov