use of org.apache.activemq.broker.TransportConnector in project vertx-proton by vert-x3.
the class ActiveMQTestBase method addAdditionalConnectors.
// Subclasses can override to add/restrict to their own connectors.
protected void addAdditionalConnectors(BrokerService brokerService, Map<String, Integer> portMap) throws Exception {
int port = PORT;
if (portMap.containsKey(AMQP_CONNECTOR_NAME)) {
port = portMap.get(AMQP_CONNECTOR_NAME);
}
TransportConnector connector = brokerService.addConnector("amqp://0.0.0.0:" + port + "?transport.transformer=" + getAmqpTransformer() + "&transport.socketBufferSize=" + getSocketBufferSize() + "&ioBufferSize=" + getIOBufferSize());
connector.setName(AMQP_CONNECTOR_NAME);
port = connector.getPublishableConnectURI().getPort();
if (LOG.isDebugEnabled()) {
LOG.debug("Using amqp port: " + port);
}
}
use of org.apache.activemq.broker.TransportConnector in project vcell by virtualcell.
the class ActiveMqTest method main.
/**
* @param args
*/
public static void main(String[] args) {
try {
BrokerService broker = new BrokerService();
broker.setBrokerName("fred");
broker.setUseShutdownHook(false);
broker.setPersistent(false);
// Add plugin
// broker.setPlugins(new BrokerPlugin[]{new JaasAuthenticationPlugin()});
// Add a network connection
NetworkConnector connector = broker.addNetworkConnector("static://" + "tcp://localhost:61616");
connector.setDuplex(true);
TransportConnector transportConnector = broker.addConnector("tcp://localhost:61616");
broker.start();
// transportConnector.
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
use of org.apache.activemq.broker.TransportConnector in project spring-framework by spring-projects.
the class StompBrokerRelayMessageHandlerIntegrationTests method startActiveMQBroker.
private void startActiveMQBroker() throws Exception {
TransportConnector stompConnector = createStompConnector(this.port);
this.activeMQBroker = new BrokerService();
this.activeMQBroker.addConnector(stompConnector);
this.activeMQBroker.setStartAsync(false);
this.activeMQBroker.setPersistent(false);
this.activeMQBroker.setUseJmx(false);
this.activeMQBroker.getSystemUsage().getMemoryUsage().setLimit(1024 * 1024 * 5);
this.activeMQBroker.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 5);
this.activeMQBroker.start();
// Reuse existing ephemeral port on restart (i.e., the next time this method
// is invoked) since it will already be configured in the relay
this.port = (this.port != 0 ? this.port : stompConnector.getServer().getSocketAddress().getPort());
}
use of org.apache.activemq.broker.TransportConnector in project spring-framework by spring-projects.
the class StompBrokerRelayMessageHandlerIntegrationTests method createStompConnector.
private TransportConnector createStompConnector(int port) throws Exception {
TransportConnector connector = new TransportConnector();
connector.setUri(new URI("stomp://localhost:" + port));
return connector;
}
Aggregations