Search in sources :

Example 26 with BrokerService

use of org.apache.activemq.broker.BrokerService in project storm by apache.

the class StormMqttIntegrationTest method start.

@BeforeClass
public static void start() throws Exception {
    LOG.warn("Starting broker...");
    broker = new BrokerService();
    broker.addConnector("mqtt://localhost:1883");
    broker.setDataDirectory("target");
    broker.start();
    LOG.debug("MQTT broker started");
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService) BeforeClass(org.junit.BeforeClass)

Example 27 with BrokerService

use of org.apache.activemq.broker.BrokerService in project hive by apache.

the class TestMsgBusConnection method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    broker = new BrokerService();
    // configure the broker
    broker.addConnector("tcp://localhost:61616?broker.persistent=false");
    broker.start();
    System.setProperty("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory");
    System.setProperty("java.naming.provider.url", "tcp://localhost:61616");
    connectClient();
    HiveConf hiveConf = new HiveConf(this.getClass());
    hiveConf.set(ConfVars.METASTORE_EVENT_LISTENERS.varname, NotificationListener.class.getName());
    hiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, "");
    hiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, "");
    hiveConf.set(HiveConf.ConfVars.METASTOREURIS.varname, "");
    hiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
    hiveConf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    hiveConf.set(HCatConstants.HCAT_MSGBUS_TOPIC_PREFIX, "planetlab.hcat");
    SessionState.start(new CliSessionState(hiveConf));
    driver = new Driver(hiveConf);
}
Also used : Driver(org.apache.hadoop.hive.ql.Driver) HiveConf(org.apache.hadoop.hive.conf.HiveConf) BrokerService(org.apache.activemq.broker.BrokerService) CliSessionState(org.apache.hadoop.hive.cli.CliSessionState)

Example 28 with BrokerService

use of org.apache.activemq.broker.BrokerService in project quickstarts by jboss-switchyard.

the class JCAInflowBindingTest method startActiveMQBroker.

public static void startActiveMQBroker() throws Exception {
    _broker = new BrokerService();
    _broker.setBrokerName("default");
    _broker.setUseJmx(false);
    _broker.setPersistent(false);
    _broker.setDataDirectoryFile(ACTIVEMQ_DATA_DIR);
    _broker.addConnector(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL);
    SystemUsage systemUsage = _broker.getSystemUsage();
    systemUsage.getMemoryUsage().setLimit(MEMORY_STORE_USAGE_LIMIT);
    systemUsage.getTempUsage().setLimit(TEMP_STORE_USAGE_LIMIT);
    _broker.start();
}
Also used : SystemUsage(org.apache.activemq.usage.SystemUsage) BrokerService(org.apache.activemq.broker.BrokerService)

Example 29 with BrokerService

use of org.apache.activemq.broker.BrokerService in project camel by apache.

the class MQTTDuplicatesTest method testMqttDuplicatesAfterBrokerRestartWithClientID.

@Test
public void testMqttDuplicatesAfterBrokerRestartWithClientID() throws Exception {
    brokerService.stop();
    brokerService.waitUntilStopped();
    LOG.info(">>>>>>>>>> Restarting broker...");
    brokerService = new BrokerService();
    brokerService.setPersistent(false);
    brokerService.setAdvisorySupport(false);
    brokerService.addConnector(MQTTTestSupport.getConnection() + "?trace=true");
    brokerService.start();
    brokerService.waitUntilStarted();
    LOG.info(">>>>>>>>>> Broker restarted");
    for (int i = 0; i < MESSAGE_COUNT; i++) {
        String body = System.currentTimeMillis() + ": Dummy-restart-with-clientID! " + i;
        templateWithClientID.asyncSendBody("direct:withClientID", body);
        Thread.sleep(WAIT_MILLIS);
    }
    assertNoDuplicates();
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Test(org.junit.Test)

Example 30 with BrokerService

use of org.apache.activemq.broker.BrokerService in project camel by apache.

the class MQTTTestSupport method newBrokerService.

public static BrokerService newBrokerService() throws Exception {
    BrokerService service = new BrokerService();
    service.setPersistent(false);
    service.setAdvisorySupport(false);
    service.addConnector(getConnection());
    return service;
}
Also used : BrokerService(org.apache.activemq.broker.BrokerService)

Aggregations

BrokerService (org.apache.activemq.broker.BrokerService)40 Test (org.junit.Test)13 URI (java.net.URI)10 ServletContext (javax.servlet.ServletContext)7 ServletContextEvent (javax.servlet.ServletContextEvent)7 MemoryPersistenceAdapter (org.apache.activemq.store.memory.MemoryPersistenceAdapter)5 Before (org.junit.Before)5 PersistenceAdapter (org.apache.activemq.store.PersistenceAdapter)4 JDBCPersistenceAdapter (org.apache.activemq.store.jdbc.JDBCPersistenceAdapter)4 Properties (java.util.Properties)3 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)3 ServerSocket (java.net.ServerSocket)2 HashMap (java.util.HashMap)2 BrokerPlugin (org.apache.activemq.broker.BrokerPlugin)2 PolicyEntry (org.apache.activemq.broker.region.policy.PolicyEntry)2 PolicyMap (org.apache.activemq.broker.region.policy.PolicyMap)2 SystemUsage (org.apache.activemq.usage.SystemUsage)2 URISupport (org.apache.activemq.util.URISupport)2 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)2 JDBCDataSource (org.hsqldb.jdbc.JDBCDataSource)2