1
我試圖初始化嵌入式activemq
JMS使用spring-boot
。它通常工作,但我也想降低內存使用量。所以我試圖提供SystemUsage
作爲一個bean。如何使用spring-boot初始化ActiveMQ的SystemUsage?
但是SystemUsage
bean未被考慮,並且activemq嵌入仍具有默認配置1GB。什麼可能是錯的?
@EnableAutoConfiguration
@EnableJms
public class AppConfig {
@Bean
public SystemUsage systemUsage() {
MemoryPropertyEditor editor = new MemoryPropertyEditor();
SystemUsage system = new SystemUsage();
MemoryUsage memory = new MemoryUsage();
editor.setAsText("20mb");
memory.setLimit((long) editor.getValue());
system.setMemoryUsage(memory);
return system;
}
}