找到了答案發布後不久:您可以使用呼叫管理器嵌入式服務器:
final AddressSettings addressSetting = new AddressSettings();
addressSetting.setMaxSizeBytes(10 * 1024 * 1024); // 10 MB
addressSetting.setPageSizeBytes(1024 * 1024); // 1 MB
server.getPagingManager().getPageStore(new SimpleString(addressName))
.applySetting(addressSetting);
或者爲所有地址可以配置對象(基於this SO answer)上設置的設置:
final Configuration hornetConfig = new ConfigurationImpl();
// other configuration...
final AddressSettings addressSetting = new AddressSettings();
addressSetting.setMaxSizeBytes(10 * 1024 * 1024); // 10 MB
addressSetting.setPageSizeBytes(1024 * 1024); // 1 MB
final Map<String, AddressSettings> addressing = new HashMap<String, AddressSettings>();
addressing.put("#", addressSetting); // the # pattern matches all addresses
hornetConfig.setAddressesSettings(addressing);