mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-3020 - supress browsers over network
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1032647 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7983abfcd6
commit
34f19297d4
|
@ -566,9 +566,16 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
|
|||
ConsumerInfo info = (ConsumerInfo) data;
|
||||
BrokerId[] path = info.getBrokerPath();
|
||||
|
||||
if (info.isBrowser()) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.info(configuration.getBrokerName() + " Ignoring sub from " + remoteBrokerName + ", browsers explicitly suppressed");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (path != null && path.length >= networkTTL) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug(configuration.getBrokerName() + " Ignoring sub from " + remoteBrokerName + ", restricted to " + networkTTL + " network hops only : " + info);
|
||||
LOG.debug(configuration.getBrokerName() + " Ignoring sub from " + remoteBrokerName + ", restricted to " + networkTTL + " network hops only : " + info);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -51,23 +51,25 @@ public class BrowseOverNetworkTest extends JmsMultipleBrokersTestSupport {
|
|||
|
||||
sendMessages("BrokerA", dest, MESSAGE_COUNT);
|
||||
|
||||
browseMessages("BrokerB", dest);
|
||||
Thread.sleep(1000);
|
||||
|
||||
Thread.sleep(2000);
|
||||
int browsed = browseMessages("BrokerB", dest);
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
MessageConsumer clientA = createConsumer("BrokerA", dest);
|
||||
MessageIdList msgsA = getConsumerMessages("BrokerA", clientA);
|
||||
msgsA.waitForMessagesToArrive(MESSAGE_COUNT);
|
||||
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(1000);
|
||||
MessageConsumer clientB = createConsumer("BrokerB", dest);
|
||||
MessageIdList msgsB = getConsumerMessages("BrokerB", clientB);
|
||||
msgsB.waitForMessagesToArrive(MESSAGE_COUNT);
|
||||
|
||||
LOG.info("A+B: " + msgsA.getMessageCount() + "+"
|
||||
+ msgsB.getMessageCount());
|
||||
assertEquals(MESSAGE_COUNT, msgsA.getMessageCount()
|
||||
+ msgsB.getMessageCount());
|
||||
assertEquals("Consumer on Broker A, should've consumed all messages", MESSAGE_COUNT, msgsA.getMessageCount());
|
||||
assertEquals("Broker B shouldn't get any messages", 0, browsed);
|
||||
}
|
||||
|
||||
public void testConsumerInfo() throws Exception {
|
||||
|
@ -185,6 +187,7 @@ public class BrowseOverNetworkTest extends JmsMultipleBrokersTestSupport {
|
|||
startAllBrokers();
|
||||
|
||||
brokers.get("BrokerA").broker.waitUntilStarted();
|
||||
brokers.get("BrokerB").broker.waitUntilStarted();
|
||||
brokers.get("BrokerC").broker.waitUntilStarted();
|
||||
brokers.get("BrokerD").broker.waitUntilStarted();
|
||||
|
||||
|
|
Loading…
Reference in New Issue