Message broker queues and MessageType
What is the standard wisdom and considerations for splitting up a message queue?
Assuming a relatively small number of messages (<1000 / day), does it make sense to combine multiple message types into one queue and use selectors to filter them? Or if one queue only processes one type of message?
Several possible considerations I can think of:
- At least in my limited knowledge of ActiveMQ, it looks like read / write security per queue. Thus, message types that need different read / write permissions need different queues.
- The message selectors seem to need the default header value (MessageType: AbcMessage) to filter by
- Bursting queues (> 10,> 100,> 1000?) Seems to affect performance more than bursting messages.
- It seems that it is easier to write client code for one type of messages for the queue. Just process every message in the queue. If you need a different type of message, subscribe to a different queue.
- ???
a source to share
Any given MQ system should be able to process many millions of messages in any given queue, I wouldn't be interested in voume at all.
I prefer queues, which have different meanings in the real world, rather than worrying about selectors. I know there are real reasons to use selectors or consume and reorder, but I prefer to keep the queues separate and not worry about the selection.
a source to share
Since it wasn't really addressed and you asked about it in your question (and this was what I was looking for when I found it), I thought I might call back, how can I filter messages on one, heterogeneous queue by type ...
If you look here , you will find that a custom property is available for all posts titled JMSType
. It is String
and is empty by default. When you post messages, ask the producer to set it to a consistent value like map
or text
, and then in your consumer use a specific message selector depending on what kind of message you want to Receive. Using the same examples, this would be JMSType = 'map'
or JMSType = 'text'
.
I was able to successfully use this technique with Java producer and C ++ consumer using the ActiveMQ-CPP library.
a source to share