https://issues.apache.org/jira/browse/AMQ-3135 - add remoteIp to network bridge advisory

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1136026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2011-06-15 13:18:42 +00:00
parent ed3f61a7b7
commit 37384a1ad1
8 changed files with 11 additions and 11 deletions

View File

@ -392,12 +392,13 @@ public class AdvisoryBroker extends BrokerFilter {
}
@Override
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
try {
if (brokerInfo != null) {
ActiveMQMessage advisoryMessage = new ActiveMQMessage();
advisoryMessage.setBooleanProperty("started", true);
advisoryMessage.setBooleanProperty("createdByDuplex", createdByDuplex);
advisoryMessage.setStringProperty("remoteIp", remoteIp);
ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic();

View File

@ -382,7 +382,7 @@ public interface Broker extends Region, Service {
ThreadPoolExecutor getExecutor();
void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex);
void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp);
void networkBridgeStopped(BrokerInfo brokerInfo);

View File

@ -312,8 +312,8 @@ public class BrokerFilter implements Broker {
return next.getExecutor();
}
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
next.networkBridgeStarted(brokerInfo, createdByDuplex);
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
next.networkBridgeStarted(brokerInfo, createdByDuplex, remoteIp);
}
public void networkBridgeStopped(BrokerInfo brokerInfo) {

View File

@ -284,7 +284,7 @@ public class EmptyBroker implements Broker {
public void nowMasterBroker() {
}
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
}
public void networkBridgeStopped(BrokerInfo brokerInfo) {

View File

@ -314,7 +314,7 @@ public class ErrorBroker implements Broker {
throw new BrokerStoppedException(this.message);
}
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
throw new BrokerStoppedException(this.message);
}

View File

@ -323,8 +323,8 @@ public class MutableBrokerFilter implements Broker {
return getNext().getExecutor();
}
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
getNext().networkBridgeStarted(brokerInfo, createdByDuplex);
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
getNext().networkBridgeStarted(brokerInfo, createdByDuplex, remoteIp);
}
public void networkBridgeStopped(BrokerInfo brokerInfo) {

View File

@ -298,7 +298,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
localSessionInfo = new SessionInfo(localConnectionInfo, 1);
localBroker.oneway(localSessionInfo);
brokerService.getBroker().networkBridgeStarted(remoteBrokerInfo, this.createdByDuplex);
brokerService.getBroker().networkBridgeStarted(remoteBrokerInfo, this.createdByDuplex, remoteBroker.toString());
NetworkBridgeListener l = this.networkBridgeListener;
if (l != null) {
l.onStart(this);
@ -347,7 +347,6 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
remoteConnectionInfo.setClientId(configuration.getName() + "_" + configuration.getBrokerName() + "_outbound");
remoteConnectionInfo.setUserName(configuration.getUserName());
remoteConnectionInfo.setPassword(configuration.getPassword());
remoteConnectionInfo.setClientIp(remoteBroker.toString());
remoteBroker.oneway(remoteConnectionInfo);
SessionInfo remoteSessionInfo = new SessionInfo(remoteConnectionInfo, 1);

View File

@ -41,7 +41,7 @@
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker1" dataDirectory="${activemq.base}/data">
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker2" dataDirectory="${activemq.base}/data">
<!-- Destination specific policies using destination names or wildcards -->
<destinationPolicy>