关于Solace订阅能否传入指定苹果类型列表的技术咨询
Solace Subscription for Specific Apple Type Subsets
Nice question! You’re in luck—Solace has exactly what you need to avoid creating dozens of duplicate subscriptions: topic sets (using curly brace syntax).
Instead of trying to jam comma-separated values into a single topic segment, format your subscription like this:
produce/{gala,delicious,seedless}/seedless/color
Here’s how it works:
- The
{}syntax lets you define a collection of exact matches for that specific topic level. - This one subscription will catch messages published to all three of your target topics:
produce/gala/seedless/colorproduce/delicious/seedless/colorproduce/seedless/seedless/color
- This works seamlessly with physical queues—Solace will route all matching messages to your queue just like it would with individual subscriptions, and it’s way cleaner to maintain.
A few quick notes:
- All modern Solace brokers support topic sets, but double-check if you’re on an extremely old version (unlikely to be an issue).
- You can include as many values as you need inside the braces (even hundreds) without impacting performance, since it’s treated as a single subscription entry by the broker.
- If you ever need to mix specific values with wildcards, you can combine them too—for example
produce/{gala,delicious,*}/seedless/colorwould match your target types plus any other apple variety.
内容的提问来源于stack exchange,提问作者jonnysteals
相关产品推荐
相关产品推荐

