title: Is there a way to expose ActiveMQ port when it is in-memory
body: <p>I'm currently developing a Spring Boot application that uses ActiveMQ &quot;Classic&quot; to communicate with MQTT enabled devices. The main problem is that I need to have in-memory ActiveMQ because when the Spring Boot application doesn't, all the messages sent to the topics can't be read because the <code>@JmsListener</code> for the topics only work in runtime(because the same is subscriber of the topic in that moment). I could use a <code>docker-compose</code> to create a stack and lock everything when ActiveMQ container is down but I can't use it into the project that I'm actually doing.
  So, is there a way to expose the ports of in-memory ActiveMQ or a way to start an ActiveMQ deamon when the Spring Boot project start and stop it when Spring Boot stops?</p>
  <p>Here is the <code>application.properties</code> file</p>
  <pre><code>    # Embedded ActiveMQ Configuration Example
      spring.activemq.broker-url=vm://embedded?broker.persistent=false,useShutdownHook=false
      spring.activemq.close-timeout=15000
      spring.activemq.in-memory=true
      spring.activemq.non-blocking-redelivery=false
      spring.activemq.password=admin
      spring.activemq.user=admin
      spring.activemq.send-timeout=0
      spring.activemq.packages.trust-all=false
      spring.activemq.packages.trusted=com.memorynotfound
      spring.activemq.pool.block-if-full=true
      spring.activemq.pool.block-if-full-timeout=-1
      spring.activemq.pool.create-connection-on-startup=true
      spring.activemq.pool.enabled=false
      spring.activemq.pool.expiry-timeout=0
      spring.activemq.pool.idle-timeout=30000
      spring.activemq.pool.max-connections=1
      spring.activemq.pool.max-sessions-per-connection=500
      spring.activemq.pool.reconnect-on-exception=true
      spring.activemq.pool.time-between-expiration-check=-1
      spring.activemq.pool.use-anonymous-producers=true
  </code></pre>