mirror of https://github.com/apache/activemq.git
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:
parent
ed3f61a7b7
commit
37384a1ad1
|
@ -392,12 +392,13 @@ public class AdvisoryBroker extends BrokerFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
|
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
|
||||||
try {
|
try {
|
||||||
if (brokerInfo != null) {
|
if (brokerInfo != null) {
|
||||||
ActiveMQMessage advisoryMessage = new ActiveMQMessage();
|
ActiveMQMessage advisoryMessage = new ActiveMQMessage();
|
||||||
advisoryMessage.setBooleanProperty("started", true);
|
advisoryMessage.setBooleanProperty("started", true);
|
||||||
advisoryMessage.setBooleanProperty("createdByDuplex", createdByDuplex);
|
advisoryMessage.setBooleanProperty("createdByDuplex", createdByDuplex);
|
||||||
|
advisoryMessage.setStringProperty("remoteIp", remoteIp);
|
||||||
|
|
||||||
ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic();
|
ActiveMQTopic topic = AdvisorySupport.getNetworkBridgeAdvisoryTopic();
|
||||||
|
|
||||||
|
|
|
@ -382,7 +382,7 @@ public interface Broker extends Region, Service {
|
||||||
|
|
||||||
ThreadPoolExecutor getExecutor();
|
ThreadPoolExecutor getExecutor();
|
||||||
|
|
||||||
void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex);
|
void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp);
|
||||||
|
|
||||||
void networkBridgeStopped(BrokerInfo brokerInfo);
|
void networkBridgeStopped(BrokerInfo brokerInfo);
|
||||||
|
|
||||||
|
|
|
@ -312,8 +312,8 @@ public class BrokerFilter implements Broker {
|
||||||
return next.getExecutor();
|
return next.getExecutor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
|
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
|
||||||
next.networkBridgeStarted(brokerInfo, createdByDuplex);
|
next.networkBridgeStarted(brokerInfo, createdByDuplex, remoteIp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void networkBridgeStopped(BrokerInfo brokerInfo) {
|
public void networkBridgeStopped(BrokerInfo brokerInfo) {
|
||||||
|
|
|
@ -284,7 +284,7 @@ public class EmptyBroker implements Broker {
|
||||||
public void nowMasterBroker() {
|
public void nowMasterBroker() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
|
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void networkBridgeStopped(BrokerInfo brokerInfo) {
|
public void networkBridgeStopped(BrokerInfo brokerInfo) {
|
||||||
|
|
|
@ -314,7 +314,7 @@ public class ErrorBroker implements Broker {
|
||||||
throw new BrokerStoppedException(this.message);
|
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);
|
throw new BrokerStoppedException(this.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -323,8 +323,8 @@ public class MutableBrokerFilter implements Broker {
|
||||||
return getNext().getExecutor();
|
return getNext().getExecutor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex) {
|
public void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp) {
|
||||||
getNext().networkBridgeStarted(brokerInfo, createdByDuplex);
|
getNext().networkBridgeStarted(brokerInfo, createdByDuplex, remoteIp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void networkBridgeStopped(BrokerInfo brokerInfo) {
|
public void networkBridgeStopped(BrokerInfo brokerInfo) {
|
||||||
|
|
|
@ -298,7 +298,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
|
||||||
localSessionInfo = new SessionInfo(localConnectionInfo, 1);
|
localSessionInfo = new SessionInfo(localConnectionInfo, 1);
|
||||||
localBroker.oneway(localSessionInfo);
|
localBroker.oneway(localSessionInfo);
|
||||||
|
|
||||||
brokerService.getBroker().networkBridgeStarted(remoteBrokerInfo, this.createdByDuplex);
|
brokerService.getBroker().networkBridgeStarted(remoteBrokerInfo, this.createdByDuplex, remoteBroker.toString());
|
||||||
NetworkBridgeListener l = this.networkBridgeListener;
|
NetworkBridgeListener l = this.networkBridgeListener;
|
||||||
if (l != null) {
|
if (l != null) {
|
||||||
l.onStart(this);
|
l.onStart(this);
|
||||||
|
@ -347,7 +347,6 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
|
||||||
remoteConnectionInfo.setClientId(configuration.getName() + "_" + configuration.getBrokerName() + "_outbound");
|
remoteConnectionInfo.setClientId(configuration.getName() + "_" + configuration.getBrokerName() + "_outbound");
|
||||||
remoteConnectionInfo.setUserName(configuration.getUserName());
|
remoteConnectionInfo.setUserName(configuration.getUserName());
|
||||||
remoteConnectionInfo.setPassword(configuration.getPassword());
|
remoteConnectionInfo.setPassword(configuration.getPassword());
|
||||||
remoteConnectionInfo.setClientIp(remoteBroker.toString());
|
|
||||||
remoteBroker.oneway(remoteConnectionInfo);
|
remoteBroker.oneway(remoteConnectionInfo);
|
||||||
|
|
||||||
SessionInfo remoteSessionInfo = new SessionInfo(remoteConnectionInfo, 1);
|
SessionInfo remoteSessionInfo = new SessionInfo(remoteConnectionInfo, 1);
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<!-- Allows us to use system properties as variables in this configuration file -->
|
<!-- Allows us to use system properties as variables in this configuration file -->
|
||||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
<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 -->
|
<!-- Destination specific policies using destination names or wildcards -->
|
||||||
<destinationPolicy>
|
<destinationPolicy>
|
||||||
|
|
Loading…
Reference in New Issue