use of org.apache.activemq.broker.TransportConnector in project activemq-artemis by apache.
the class MulticastDiscoveryOnFaultyNetworkTest method bridgeBrokers.
@Override
protected NetworkConnector bridgeBrokers(BrokerService localBroker, BrokerService remoteBroker, boolean dynamicOnly, int networkTTL, boolean conduit, boolean failover) throws Exception {
String networkDisoveryUrlString = useStaticDiscovery ? "static:(" + remoteBroker.getTransportConnectors().get(0).getPublishableConnectString() + ")?useExponentialBackOff=false" : "multicast://default?group=TESTERIC&useLocalHost=false";
DiscoveryNetworkConnector connector = new DiscoveryNetworkConnector(new URI(networkDisoveryUrlString));
connector.setDynamicOnly(dynamicOnly);
connector.setNetworkTTL(networkTTL);
connector.setDuplex(useDuplexNetworkBridge);
maxSetupTime = 2000;
if (!useStaticDiscovery) {
List<TransportConnector> transportConnectors = remoteBroker.getTransportConnectors();
if (!transportConnectors.isEmpty()) {
TransportConnector mCastTrpConnector = (transportConnectors.get(0));
mCastTrpConnector.setDiscoveryUri(new URI("multicast://default?group=TESTERIC"));
}
}
localBroker.addNetworkConnector(connector);
return connector;
}
use of org.apache.activemq.broker.TransportConnector in project activemq-artemis by apache.
the class ConsumeUncompressedCompressedMessageTest method createBroker.
protected BrokerService createBroker(boolean delete) throws Exception {
BrokerService answer = new BrokerService();
answer.setPersistent(false);
answer.setDeleteAllMessagesOnStartup(true);
answer.setSchedulerSupport(false);
answer.setUseJmx(true);
TransportConnector connector = answer.addConnector("tcp://localhost:0");
tcpUri = connector.getConnectUri();
return answer;
}
use of org.apache.activemq.broker.TransportConnector in project spring-framework by spring-projects.
the class ReactorNettyTcpStompClientTests method createStompConnector.
private TransportConnector createStompConnector() throws Exception {
TransportConnector connector = new TransportConnector();
connector.setUri(new URI("stomp://127.0.0.1:0"));
return connector;
}
use of org.apache.activemq.broker.TransportConnector in project spring-framework by spring-projects.
the class ReactorNettyTcpStompClientTests method setup.
@BeforeEach
public void setup(TestInfo testInfo) throws Exception {
logger.debug("Setting up before '" + testInfo.getTestMethod().get().getName() + "'");
TransportConnector stompConnector = createStompConnector();
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();
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.afterPropertiesSet();
this.client = new ReactorNettyTcpStompClient("127.0.0.1", stompConnector.getServer().getSocketAddress().getPort());
this.client.setMessageConverter(new StringMessageConverter());
this.client.setTaskScheduler(taskScheduler);
}
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();
LOG.debug("Using amqp port: {}", port);
}
Aggregations