final List<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
final PolicyEntry entry = new PolicyEntry();
entry.setQueue(">");
entry.setMemoryLimit(1024 * 1024 * 1); // Set to 1 MB
entry.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
entry.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
policyEntries.add(entry);
// This is to turn of the default behavior of storing topic messages for retroactive consumption
final PolicyEntry topicPolicyEntry = new PolicyEntry();
topicPolicyEntry.setTopic(">");