Package org.apache.activemq.network

Examples of org.apache.activemq.network.DemandForwardingBridge


            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
                config.setBrokerName(localBroker.getBrokerName());
                DemandForwardingBridge bridge = new DemandForwardingBridge(config, TransportFactory.connect(localURI), TransportFactory.connect(remoteURI));
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here


            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
                config.setBrokerName(localBroker.getBrokerName());
                DemandForwardingBridge bridge = new DemandForwardingBridge(config, TransportFactory.connect(localURI), TransportFactory.connect(remoteURI));
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
                config.setBrokerName(localBroker.getBrokerName());
                DemandForwardingBridge bridge = new DemandForwardingBridge(config, TransportFactory.connect(localURI), TransportFactory.connect(remoteURI));
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

            remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
            localURI  = ((TransportConnector)localTransports.get(0)).getConnectUri();

            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                DemandForwardingBridge bridge = new DemandForwardingBridge(TransportFactory.connect(localURI),
                                                                           TransportFactory.connect(remoteURI)) {
                    protected void serviceLocalCommand(Command command) {
                        if (command.isMessageDispatch()) {
                            // Keep track of the number of message dispatches through the bridge
                            msgDispatchCount.incrementAndGet();
                        }

                        super.serviceLocalCommand(command);
                    }
                };
                bridge.setLocalBrokerName(localBroker.getBrokerName());
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

        assertNotNull(m);
    }

    protected void setUp() throws Exception {
        super.setUp();
        bridge = new DemandForwardingBridge(createTransport(), createRemoteTransport());
        bridge.setLocalBrokerName("local");
        bridge.setDispatchAsync(false);
        bridge.start();       
    }
View Full Code Here

            remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
            localURI  = ((TransportConnector)localTransports.get(0)).getConnectUri();

            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                DemandForwardingBridge bridge = new DemandForwardingBridge(TransportFactory.connect(localURI),
                                                                           TransportFactory.connect(remoteURI));
                bridge.setLocalBrokerName(localBroker.getBrokerName());
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

            remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
            localURI  = ((TransportConnector)localTransports.get(0)).getConnectUri();

            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                DemandForwardingBridge bridge = new DemandForwardingBridge(TransportFactory.connect(localURI),
                                                                           TransportFactory.connect(remoteURI));
                bridge.setLocalBrokerName(localBroker.getBrokerName());
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

            remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
            localURI  = ((TransportConnector)localTransports.get(0)).getConnectUri();

            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                DemandForwardingBridge bridge = new DemandForwardingBridge(TransportFactory.connect(localURI),
                                                                           TransportFactory.connect(remoteURI));
                bridge.setLocalBrokerName(localBroker.getBrokerName());
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
                config.setBrokerName(localBroker.getBrokerName());
                DemandForwardingBridge bridge = new DemandForwardingBridge(config, TransportFactory.connect(localURI), TransportFactory.connect(remoteURI));
                bridge.setBrokerService(localBroker);
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

            // Ensure that we are connecting using tcp
            if (remoteURI.toString().startsWith("tcp:") && localURI.toString().startsWith("tcp:")) {
                NetworkBridgeConfiguration config = new NetworkBridgeConfiguration();
                config.setBrokerName(localBroker.getBrokerName());
                DemandForwardingBridge bridge = new DemandForwardingBridge(config, TransportFactory.connect(localURI), TransportFactory.connect(remoteURI));
                bridge.setBrokerService(localBroker);
                bridges.add(bridge);

                bridge.start();
            } else {
                throw new Exception("Remote broker or local broker is not using tcp connectors");
            }
        } else {
            throw new Exception("Remote broker or local broker has no registered connectors.");
View Full Code Here

TOP

Related Classes of org.apache.activemq.network.DemandForwardingBridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.