io.fabric8.quickstarts.activemq.Receiver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springboot-activemq Show documentation
Show all versions of springboot-activemq Show documentation
Shows how to use ActiveMQ with Spring Boot in the Java Container
package io.fabric8.quickstarts.activemq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.util.FileSystemUtils;
import java.io.File;
public class Receiver {
/**
* Get a copy of the application context
*/
@Autowired
ConfigurableApplicationContext context;
/**
* When you receive a message, print it out, then shut down the application.
* Finally, clean up any ActiveMQ server stuff.
*/
public void receiveMessage(String message) {
System.out.println("Received <" + message + ">");
context.close();
FileSystemUtils.deleteRecursively(new File("activemq-data"));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy