Search in sources :

Example 1 with TransportServer

use of org.apache.activemq.transport.TransportServer in project activemq-artemis by apache.

the class CheckDuplicateMessagesOnDuplexTest method createLocalBroker.

private void createLocalBroker() throws Exception {
    localBroker = new BrokerService();
    localBroker.setBrokerName("LOCAL");
    localBroker.setUseJmx(true);
    localBroker.setSchedulePeriodForDestinationPurge(5000);
    ManagementContext managementContext = new ManagementContext();
    managementContext.setCreateConnector(false);
    localBroker.setManagementContext(managementContext);
    PersistenceAdapter persistenceAdapter = persistenceAdapterFactory("target/local");
    localBroker.setPersistenceAdapter(persistenceAdapter);
    List<TransportConnector> transportConnectors = new ArrayList<>();
    DebugTransportFactory tf = new DebugTransportFactory();
    TransportServer transport = tf.doBind(URI.create("nio://127.0.0.1:23539"));
    TransportConnector transportConnector = new TransportConnector(transport);
    transportConnector.setName("tc");
    transportConnector.setAuditNetworkProducers(true);
    transportConnectors.add(transportConnector);
    localBroker.setTransportConnectors(transportConnectors);
}
Also used : TransportConnector(org.apache.activemq.broker.TransportConnector) ArrayList(java.util.ArrayList) ManagementContext(org.apache.activemq.broker.jmx.ManagementContext) TcpTransportServer(org.apache.activemq.transport.tcp.TcpTransportServer) TransportServer(org.apache.activemq.transport.TransportServer) BrokerService(org.apache.activemq.broker.BrokerService) LevelDBPersistenceAdapter(org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter) KahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter) PersistenceAdapter(org.apache.activemq.store.PersistenceAdapter)

Aggregations

ArrayList (java.util.ArrayList)1 BrokerService (org.apache.activemq.broker.BrokerService)1 TransportConnector (org.apache.activemq.broker.TransportConnector)1 ManagementContext (org.apache.activemq.broker.jmx.ManagementContext)1 PersistenceAdapter (org.apache.activemq.store.PersistenceAdapter)1 KahaDBPersistenceAdapter (org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter)1 LevelDBPersistenceAdapter (org.apache.activemq.store.leveldb.LevelDBPersistenceAdapter)1 TransportServer (org.apache.activemq.transport.TransportServer)1 TcpTransportServer (org.apache.activemq.transport.tcp.TcpTransportServer)1