ActiveMQ and maxPageSize

前端 未结 1 676
失恋的感觉
失恋的感觉 2021-01-19 07:59

I would like to set the maxPageSize to a larger number from its default 200.

This is how I set in the activemq.xml file:


           


        
相关标签:
1条回答
  • 2021-01-19 08:44

    Max page size simply indicates the number of messages that will be loaded into memory, so the impact is.. that it will consume more memory.

    Reading between the lines though, the reason that you are doing this is an anti-pattern. Queue browsing as part of an application is really a misuse of messaging - a message queue works best when treated as a queue. First in, first out. Not as an array that you scan to see whether a message has arrived.

    You are much better off consuming each of the messages, and either:

    1. sorting them onto a bunch of other queues depending on their payload and then processing that second level of queues differently, or
    2. storing the payloads into a database and selecting based on the content.
    0 讨论(0)
提交回复
热议问题