Test code using ActiveMQ BrokerService breaks after upgrading Spring Boot from 2.7.x to 3.0.3

765 Views Asked by At

My project currently has test code that connects to an ActiveMQ broker configured as follows:

import lombok.extern.slf4j.Slf4j;
import org.apache.activemq.broker.BrokerService;

@Slf4j
public class MqTestConfiguration {

  public static final String BROKER_URL = "tcp://localhost:61616";

  public static BrokerService getBrokerServiceInstance() throws Exception {
    BrokerService brokerService = new BrokerService();
    brokerService.setUseJmx(false);
    brokerService.setPersistent(false);
    brokerService.addConnector(BROKER_URL);
    return brokerService;
  }
}

After upgrading Spring Boot from 2.7.x to 3.0.3, the org.springframework.boot:spring-boot-starter-activemq dependency no longer resolves since according to the Spring Boot 3.0 Migration Guide, support for Apache ActiveMQ "Classic" has been removed. Thus, this code fails to compile.

What is the recommendation for this type of code? I've noticed on Maven Central that org.springframework.boot:spring-boot-starter-activemq:2.7.9 was recently released but that no 3.0.x releases exist. Does this mean that going forward, Spring won't provide any starter support for ActiveMQ "Classic" on the 3.0.x line? Is the recommendation to migrate this code to use ActiveMQ Artemis instead after migrating to Spring Boot 3.0.x? I have seen that ActiveMQ Artemis is discussed in the latest Spring Boot Messaging documentation, so I'm just trying to get a sense of where the project support and direction is headed. If so, is there a guide that discusses how to migrate this type of code to ActiveMQ Artemis? I appreciate any guidance here that anyone can provide.

0

There are 0 best solutions below