Topic/Queue policyEntry setup suggestions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Topic/Queue policyEntry setup suggestions

liny
Hi,

I have Topic/Queue policyEntry setup question in activemq.xml and would like your suggestions.
My broker has two Topic policyEntries setup at the beginning, like below:
                <policyEntry topic="RTD.X_NEXT_SETUP" producerFlowControl="true" memoryLimit="8mb">
                  <pendingSubscriberPolicy>
                    <vmCursor />
                  </pendingSubscriberPolicy>
                  <subscriptionRecoveryPolicy>
                    <fixedCountSubscriptionRecoveryPolicy maximumSize="8"/>
                  </subscriptionRecoveryPolicy>
                </policyEntry>
                <policyEntry topic="OTD.A_METRICS" producerFlowControl="true" memoryLimit="1mb">
                  <pendingSubscriberPolicy>
                    <vmCursor />
                  </pendingSubscriberPolicy>
                  <subscriptionRecoveryPolicy>
                    <lastImageSubscriptionRecoveryPolicy/>
                  </subscriptionRecoveryPolicy>
                </policyEntry>

You can see that I have a "RTD.X_NEXT_SETUP" Topic with fixed 8 size recovery policy and "OTD.A_METRICS" Topic with last image recovery policy.
Now I want to create a new topic producer/consumer for another purpose, so I need to add below into activemq.xml and restart broker by "activemq restart" command.
                <policyEntry topic="OTD.B_IDX" producerFlowControl="true" >
                  <pendingSubscriberPolicy>
                    <vmCursor />
                  </pendingSubscriberPolicy>
                  <subscriptionRecoveryPolicy>
                    <fixedCountSubscriptionRecoveryPolicy maximumSize="3"/>
                  </subscriptionRecoveryPolicy>
                </policyEntry>

You can see "OTD.B_IDX" Topic needs to keep last 3 messages to let new consumer gets last messages when connected to broker.
So next time I need another new Topic, say "keep last 5 messages", I need to setup in activemq.xml and restart broker again.
This is not sutible, especially for production mode.
Production will be impacted when restarting.
And last messages will also be gone after restarting.

So I'd like to ask:
1. Is there any better flexible way to setup such policyEntry? You can see my setup is one purpose, one policyEntry. I'd like to know how you do.
2. Is there any better way to enable new setup without restart?

Thanks for any suggestions!!!