All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.fabric8.quickstarts.activemq.Receiver Maven / Gradle / Ivy

There is a newer version: 2.2.28
Show newest version
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