// or small enough not to blow memory limit
int pendingMessageLimit = 50;
if (pendingSubscriberPolicy instanceof FilePendingSubscriberMessageStoragePolicy) {
pendingMessageLimit = 500;
}
ConstantPendingMessageLimitStrategy pendingMessageLimitStrategy = new ConstantPendingMessageLimitStrategy();
pendingMessageLimitStrategy.setLimit(pendingMessageLimit);
entry.setPendingMessageLimitStrategy(pendingMessageLimitStrategy);
// to keep the limit in check and up to date rather than just the first few, evict some
OldestMessageEvictionStrategy messageEvictionStrategy = new OldestMessageEvictionStrategy();
// whether to check expiry before eviction, default limit 1000 is fine as no ttl set in this test