Jaewoong Choi created AMQ-4667:
----------------------------------
Summary: There's no (official) way to configure
VMPendingMessageCursor for non-persistent topic message cursor when using
StoreDurableSubscriberCursor for the durable topic subscribers
Key: AMQ-4667
URL: https://issues.apache.org/jira/browse/AMQ-4667
Project: ActiveMQ
Issue Type: Improvement
Components: Broker
Affects Versions: 5.7.0
Reporter: Jaewoong Choi
Priority: Minor
By default, with BrokerService#persistent=true, TopicDurableSubscription uses
StoreDurableSubscriberCursor class instance like the following:
StoreDurableSubscriberCursor
nonPersistent: FilePendingMessageCursor
persistent: TopicStorePrefetch
And it looks apparently that there's no way to replace the nonPersistent cursor
to VMPendingMessageCursor from the above. Actually it does if we set
BrokerService#persistent =false but then, the broker is configured to use
MemoryPersistenceAdapter and I can't use the real persistent adapter such as
KahaDBPersistenceAdapter).
The solution could be providing one setter and one getter to the
StoreDurableSubscriberCursor class:
{code}
void setNonPersistent(PendingMessageCursor cursor)
boolean isPrioritizedMessages()
{code}
so that the code like the following can be used:
{code}
PolicyEntry policyEntry = new PolicyEntry();
policyEntry.setPendingDurableSubscriberPolicy(new
StorePendingDurableSubscriberMessageStoragePolicy() {
@Override
public PendingMessageCursor
getSubscriberPendingMessageCursor(Broker broker, String clientId,
String name, int maxBatchSize, DurableTopicSubscription
sub) {
StoreDurableSubscriberCursor cursor =
(StoreDurableSubscriberCursor) super.getSubscriberPendingMessageCursor(broker,
clientId, name, maxBatchSize, sub);
cursor.setNonPersistent(new
VMPendingMessageCursor(cursor.isPrioritizedMessages()));
return cursor;
}
});
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira