membersound
membersound

Reputation: 86727

How to initialize SystemUsage of ActiveMQ with spring-boot?

I'm trying to initialize embedded activemq JMS using spring-boot. It works in general, but I want to also lower the memory usage. Therefore I'm trying to provide the SystemUsage as a bean.

But the SystemUsage bean is not taken into account and the activemq embedded has still the default configuration of 1GB . What might be wrong?

@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;
    }
}

Upvotes: 1

Views: 708

Answers (1)

Petter Nordlander
Petter Nordlander

Reputation: 22279

You have to inject that bean manually to the amq broker if you need to alter the default config.

So I guess you are stuck with manually fire up the broker using spring xml or java somewhere to set that property.

Upvotes: 1

Related Questions