Search in sources :

Example 1 with Broker

use of org.apache.activemq.apollo.broker.Broker in project fabric8 by jboss-fuse.

the class DetectingGatewayTest method createBroker.

public Broker createBroker(String hostname) {
    Broker broker = new Broker();
    BrokerDTO config = broker.config();
    // Configure the virtual host..
    VirtualHostDTO virtualHost = new VirtualHostDTO();
    virtualHost.id = hostname;
    virtualHost.host_names.add(hostname);
    config.virtual_hosts.add(virtualHost);
    // Configure the connectors
    AcceptingConnectorDTO connector = new AcceptingConnectorDTO();
    connector.connection_limit = 100;
    connector.bind = "tcp://0.0.0.0:0";
    config.connectors.clear();
    config.connectors.add(connector);
    return broker;
}
Also used : VirtualHostDTO(org.apache.activemq.apollo.dto.VirtualHostDTO) Broker(org.apache.activemq.apollo.broker.Broker) AcceptingConnectorDTO(org.apache.activemq.apollo.dto.AcceptingConnectorDTO) BrokerDTO(org.apache.activemq.apollo.dto.BrokerDTO)

Example 2 with Broker

use of org.apache.activemq.apollo.broker.Broker in project fabric8 by jboss-fuse.

the class DetectingGatewayTest method startBrokers.

@Before
public void startBrokers() {
    for (int i = 0; i < 2; i++) {
        // create a broker..
        String name = "broker" + i;
        Broker broker = createBroker(name);
        ServiceControl.start(broker);
        brokers.add(broker);
        // Add a service map entry for the broker.
        ServiceDTO details = new ServiceDTO();
        details.setId(name);
        details.setVersion("1.0");
        details.setContainer("testing");
        details.setBundleName("none");
        details.setBundleVersion("1.0");
        List<String> services = Arrays.asList("stomp://localhost:" + portOfBroker(i), "mqtt://localhost:" + portOfBroker(i), "amqp://localhost:" + portOfBroker(i), "tcp://localhost:" + portOfBroker(i));
        details.setServices(services);
        serviceMap.serviceUpdated(name, details);
        println(String.format("Broker %s is exposing: %s", name, services));
    }
}
Also used : Broker(org.apache.activemq.apollo.broker.Broker) ServiceDTO(io.fabric8.gateway.ServiceDTO) Before(org.junit.Before)

Example 3 with Broker

use of org.apache.activemq.apollo.broker.Broker in project fabric8 by jboss-fuse.

the class DetectingGatewayVirtualHostTest method createBroker.

public Broker createBroker(String hostname) {
    Broker broker = new Broker();
    BrokerDTO config = broker.config();
    // Configure the virtual host..
    VirtualHostDTO virtualHost = new VirtualHostDTO();
    virtualHost.id = hostname;
    virtualHost.host_names.add(hostname);
    config.virtual_hosts.add(virtualHost);
    // Configure the connectors
    AcceptingConnectorDTO connector = new AcceptingConnectorDTO();
    connector.connection_limit = 100;
    connector.bind = "tcp://0.0.0.0:0";
    config.connectors.clear();
    config.connectors.add(connector);
    return broker;
}
Also used : VirtualHostDTO(org.apache.activemq.apollo.dto.VirtualHostDTO) Broker(org.apache.activemq.apollo.broker.Broker) AcceptingConnectorDTO(org.apache.activemq.apollo.dto.AcceptingConnectorDTO) BrokerDTO(org.apache.activemq.apollo.dto.BrokerDTO)

Example 4 with Broker

use of org.apache.activemq.apollo.broker.Broker in project fabric8 by jboss-fuse.

the class DetectingGatewayVirtualHostTest method startBrokers.

@Before
public void startBrokers() {
    for (int i = 0; i < 2; i++) {
        // create a broker..
        String name = "broker";
        Broker broker = createBroker(name);
        ServiceControl.start(broker);
        brokers.add(broker);
        // Add a service map entry for the broker.
        ServiceDTO details = new ServiceDTO();
        details.setId(name + i);
        details.setVersion("1.0");
        details.setContainer("testing");
        details.setBundleName("none");
        details.setBundleVersion("1.0");
        List<String> services = Arrays.asList("stomp://localhost:" + portOfBroker(i), "mqtt://localhost:" + portOfBroker(i), "amqp://localhost:" + portOfBroker(i), "tcp://localhost:" + portOfBroker(i));
        details.setServices(services);
        serviceMap.serviceUpdated(name, details);
        println(String.format("Broker %s is exposing: %s", name, services));
    }
}
Also used : Broker(org.apache.activemq.apollo.broker.Broker) ServiceDTO(io.fabric8.gateway.ServiceDTO) Before(org.junit.Before)

Example 5 with Broker

use of org.apache.activemq.apollo.broker.Broker in project fabric8 by jboss-fuse.

the class ExtendedBurnIn method createBroker.

public Broker createBroker(String hostname) {
    Broker broker = new Broker();
    BrokerDTO config = broker.config();
    // Configure the virtual host..
    VirtualHostDTO virtualHost = new VirtualHostDTO();
    virtualHost.id = hostname;
    virtualHost.host_names.add(hostname);
    config.virtual_hosts.add(virtualHost);
    // Configure the connectors
    AcceptingConnectorDTO connector = new AcceptingConnectorDTO();
    connector.connection_limit = 100;
    connector.bind = "tcp://0.0.0.0:0";
    config.connectors.clear();
    config.connectors.add(connector);
    return broker;
}
Also used : VirtualHostDTO(org.apache.activemq.apollo.dto.VirtualHostDTO) Broker(org.apache.activemq.apollo.broker.Broker) AcceptingConnectorDTO(org.apache.activemq.apollo.dto.AcceptingConnectorDTO) BrokerDTO(org.apache.activemq.apollo.dto.BrokerDTO)

Aggregations

Broker (org.apache.activemq.apollo.broker.Broker)6 AcceptingConnectorDTO (org.apache.activemq.apollo.dto.AcceptingConnectorDTO)3 BrokerDTO (org.apache.activemq.apollo.dto.BrokerDTO)3 VirtualHostDTO (org.apache.activemq.apollo.dto.VirtualHostDTO)3 Before (org.junit.Before)3 ServiceDTO (io.fabric8.gateway.ServiceDTO)2