Thanks a lot @Aaron for your insightful feedback. In order for this to work, it is my understanding that I need to do following. Please let me know if this makes sense.
- Create Topic Endpoints: ‘OMS/EQ/AK’ and ‘OMS/EQ/AS’
- Create Queue: ‘OMS/EQ’ with mapped topics ‘OMS/EQ/AK’ and ‘OMS/EQ/AS’
- The publisher will send following messages:
a. Msg1 Destination Header: OMS/EQ/AK (I think I can no longer send OMS/EQ/AK/1)
b. Msg2 Destination Header: OMS/EQ/AK (I think I can no longer send OMS/EQ/AK/2)
c. Msg3 Destination Header: OMS/EQ/AS - Consumer1 having 2 instances subscribes to queue ‘OMS/EQ’ and uses wild card of ‘OMS/EQ/>’ to get all 3 messages
- Consumer2 having 2 instances subscribes to queue ‘OMS/EQ’ and uses wild card of ‘OMS/EQ/AK’ to get only first 2 messages. I think I cannot make this more granular.
I am using Spring Cloud Stream 3.0.7 and Stream Listener based annotation for consumer (not yet on functional approach). Please do share any code sample if you have, especially the configuration for filtering.