Giriş
Şu satırı dahil ederiz
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
Örnek
Şu satırı dahil ederiz
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
Şöyle yaparız
public final class ActiveMQBroker { public static final String BROKER_URL = "tcp://localhost:61616"; private EmbeddedActiveMQ broker; ActiveMQBroker() throws Exception { ConfigurationImpl configuration = new ConfigurationImpl(); configuration.setSecurityEnabled(false); configuration.setPersistenceEnabled(false); configuration.addAcceptorConfiguration("my-acceptor", BROKER_URL); broker = new EmbeddedActiveMQ(); broker.setConfiguration(configuration); broker.start(); } public void stop() throws Exception { broker.stop(); } }
Hiç yorum yok:
Yorum Gönder