Morning everything
Recently, I have been struggling with spring-boot-artemis-starter. My understanding of spring-boot support was as follows:
- set
spring.artemis.mode=embeddedand, like tomcat, spring-boot, will manage the broker available through tcp (server mode). The following command must be successful:nc -zv localhost 61616 - set
spring.artmis.mode=nativeand spring-boot will only configure the jms template according to the properties spring.artemis.*(client mode).
Client mode works fine with a standalone artemis server on my machine. Unfortunately, I was never able to get to the tcp port in server mode.
I would be grateful if someone confirms my understanding of the built-in mode.
Thanks for the tour help
After some digging, I noticed that the implementation provided out of the box using spring-boot-starter-artemis uses an acceptor org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory. I wonder if this is not the main reason (again, I am by no means an expert). But there seems to be a way to tweak the artemis configuration. So I tried the following configuration with no luck:
@SpringBootApplication
public class MyBroker {
public static void main(String[] args) throws Exception {
SpringApplication.run(MyBroker.class, args);
}
@Autowired
private ArtemisProperties artemisProperties;
@Bean
public ArtemisConfigurationCustomizer artemisConfigurationCustomizer() {
return configuration -> {
try {
configuration.addAcceptorConfiguration("netty", "tcp://localhost:" + artemisProperties.getPort());
} catch (Exception e) {
throw new RuntimeException("Failed to add netty transport acceptor to artemis instance");
}
};
}
}
source
share