use of org.apache.activemq.artemis.rest.MessageServiceManager in project activemq-artemis by apache.
the class PersistentPushQueueConsumerTest method startup.
public static void startup() throws Exception {
Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
activeMQServer.start();
deployment = EmbeddedContainer.start();
manager = new MessageServiceManager(null);
manager.start();
deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}
use of org.apache.activemq.artemis.rest.MessageServiceManager in project activemq-artemis by apache.
the class PersistentPushTopicConsumerTest method startup.
public static void startup() throws Exception {
deployment = EmbeddedContainer.start();
manager = new MessageServiceManager(null);
manager.start();
deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
deployment.getRegistry().addPerRequestResource(Receiver.class);
}
use of org.apache.activemq.artemis.rest.MessageServiceManager in project activemq-artemis by apache.
the class RestMessagingBootstrapListener method contextInitialized.
@Override
public void contextInitialized(ServletContextEvent contextEvent) {
ServletContext context = contextEvent.getServletContext();
Registry registry = (Registry) context.getAttribute(Registry.class.getName());
if (registry == null) {
throw new RuntimeException("You must install RESTEasy as a Bootstrap Listener and it must be listed before this class");
}
String configfile = context.getInitParameter("rest.messaging.config.file");
deserializationBlackList = context.getInitParameter(ObjectInputStreamWithClassLoader.BLACKLIST_PROPERTY);
deserializationWhiteList = context.getInitParameter(ObjectInputStreamWithClassLoader.WHITELIST_PROPERTY);
manager = new MessageServiceManager(this);
if (configfile != null) {
manager.setConfigResourcePath(configfile);
}
try {
manager.start();
registry.addSingletonResource(manager.getQueueManager().getDestination());
registry.addSingletonResource(manager.getTopicManager().getDestination());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations