Search in sources :

Example 1 with Transport

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;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport)

Example 2 with Transport

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();
}
Also used : Transport(org.apache.activemq.transport.Transport) File(java.io.File) Before(org.junit.Before)

Example 3 with Transport

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;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport)

Example 4 with Transport

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;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport)

Example 5 with Transport

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;
}
Also used : StubConnection(org.apache.activemq.broker.StubConnection) Transport(org.apache.activemq.transport.Transport) FailoverTransport(org.apache.activemq.transport.failover.FailoverTransport) URI(java.net.URI)

Aggregations

Transport (org.apache.activemq.transport.Transport)31 StubConnection (org.apache.activemq.broker.StubConnection)16 URI (java.net.URI)12 IOException (java.io.IOException)5 ActiveMQConnection (org.apache.activemq.ActiveMQConnection)5 TransportListener (org.apache.activemq.transport.TransportListener)5 FailoverTransport (org.apache.activemq.transport.failover.FailoverTransport)5 ActiveMQSessionGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.ActiveMQSessionGetter)3 SocketGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.SocketGetter)3 URISyntaxException (java.net.URISyntaxException)3 ActiveMQSession (org.apache.activemq.ActiveMQSession)3 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)3 TransportAcceptListener (org.apache.activemq.transport.TransportAcceptListener)3 MockTransport (org.apache.activemq.transport.mock.MockTransport)3 TransportGetter (com.navercorp.pinpoint.plugin.activemq.client.field.getter.TransportGetter)2 Socket (java.net.Socket)2 JMSException (javax.jms.JMSException)2 ActiveMQMessage (org.apache.activemq.command.ActiveMQMessage)2 MessageDispatch (org.apache.activemq.command.MessageDispatch)2 File (java.io.File)1