use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class FailoverTransportBrokerTest method createFailoverConnection.
protected StubConnection createFailoverConnection(TransportListener listener) throws Exception {
URI failoverURI = new URI("failover://" + newURI(0) + "," + newURI(1) + "");
Transport transport = TransportFactory.connect(failoverURI);
StubConnection connection = new StubConnection(transport, listener);
connections.add(connection);
return connection;
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class FanoutTransportBrokerTest method createFanoutConnection.
protected StubConnection createFanoutConnection() throws Exception {
URI fanoutURI = new URI("fanout://(static://(" + newURI(0) + "," + "mock://" + newURI(1) + "))?fanOutQueues=true");
Transport transport = TransportFactory.connect(fanoutURI);
StubConnection connection = new StubConnection(transport);
connections.add(connection);
return connection;
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class FailoverTransportTest method testReconnectUnlimited.
@Test(timeout = 30000)
@Ignore("Test fails on windows")
public void testReconnectUnlimited() throws Exception {
Transport transport = TransportFactory.connect(new URI("failover://(tcp://0.0.0.0:61616)?useExponentialBackOff=false&reconnectDelay=0&initialReconnectDelay=0"));
transport.setTransportListener(new TransportListener() {
@Override
public void onCommand(Object command) {
}
@Override
public void onException(IOException error) {
}
@Override
public void transportInterupted() {
}
@Override
public void transportResumed() {
}
});
transport.start();
this.failoverTransport = transport.narrow(FailoverTransport.class);
assertTrue("no implicit limit of 1000", Wait.waitFor(new Wait.Condition() {
@Override
public boolean isSatisified() throws Exception {
return failoverTransport.getConnectFailures() > 1002;
}
}));
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class FailoverTransportTest method createTransport.
protected Transport createTransport() throws Exception {
Transport transport = TransportFactory.connect(new URI("failover://(tcp://localhost:1234?transport.connectTimeout=10000)"));
transport.setTransportListener(new TransportListener() {
@Override
public void onCommand(Object command) {
}
@Override
public void onException(IOException error) {
}
@Override
public void transportInterupted() {
}
@Override
public void transportResumed() {
}
});
transport.start();
this.failoverTransport = transport.narrow(FailoverTransport.class);
return transport;
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class TcpTransportServerTest method hasTransportLogger.
private boolean hasTransportLogger(Transport transport) {
boolean end = false;
Transport current = transport;
while (!end) {
if (current instanceof TransportFilter) {
TransportFilter filter = (TransportFilter) current;
if (filter instanceof TransportLogger) {
return true;
}
current = filter.getNext();
} else {
end = true;
}
}
return false;
}
Aggregations