use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class BrokerNetworkWithStuckMessagesTest method createRemoteConnection.
protected StubConnection createRemoteConnection() throws Exception {
Transport transport = TransportFactory.connect(remoteConnector.getServer().getConnectURI());
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 BrokerNetworkWithStuckMessagesTest method setUp.
@Before
public void setUp() throws Exception {
// For those who want visual confirmation:
// Uncomment the following to enable JMX support on a port number to use
// Jconsole to view each broker. You will need to add some calls to
// Thread.sleep() to be able to actually slow things down so that you
// can manually see JMX attrs.
// System.setProperty("com.sun.management.jmxremote", "");
// System.setProperty("com.sun.management.jmxremote.port", "1099");
// System.setProperty("com.sun.management.jmxremote.authenticate", "false");
// System.setProperty("com.sun.management.jmxremote.ssl", "false");
// Create the local broker
createBroker();
// Create the remote broker
createRemoteBroker();
// Remove the activemq-data directory from the creation of the remote broker
FileUtils.deleteDirectory(new File("activemq-data"));
// Create a network bridge between the local and remote brokers so that
// demand-based forwarding can take place
NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
config.setBrokerName("local");
config.setDispatchAsync(false);
config.setDuplex(true);
Transport localTransport = createTransport();
Transport remoteTransport = createRemoteTransport();
// Create a network bridge between the two brokers
bridge = new DemandForwardingBridge(config, localTransport, remoteTransport);
bridge.setBrokerService(localBroker);
bridge.start();
// introduce a second broker/bridge on remote that should not get any messages because of networkTtl=1
// local <-> remote <-> secondRemote
createSecondRemoteBroker();
config = new NetworkBridgeConfiguration();
config.setBrokerName("remote");
config.setDuplex(true);
localTransport = createRemoteTransport();
remoteTransport = createSecondRemoteTransport();
// Create a network bridge between the two brokers
bridge = new DemandForwardingBridge(config, localTransport, remoteTransport);
bridge.setBrokerService(remoteBroker);
bridge.start();
waitForBridgeFormation();
}
use of org.apache.activemq.transport.Transport in project activemq-artemis by apache.
the class ProxyTestSupport method createRemoteProxyConnection.
protected StubConnection createRemoteProxyConnection() throws Exception {
Transport transport = TransportFactory.connect(remoteProxyConnector.getServer().getConnectURI());
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 ProxyTestSupport method createRemoteConnection.
protected StubConnection createRemoteConnection() throws Exception {
Transport transport = TransportFactory.connect(remoteConnector.getServer().getConnectURI());
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 DiscoveryTransportBrokerTest method createFailoverConnection.
protected StubConnection createFailoverConnection() throws Exception {
URI failoverURI = new URI("discovery:(" + getDiscoveryUri() + ")?startupMaxReconnectAttempts=10&initialReconnectDelay=1000");
Transport transport = TransportFactory.connect(failoverURI);
StubConnection connection = new StubConnection(transport);
connections.add(connection);
return connection;
}
Aggregations