mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3918 - don't bind http based transports to local host name and do better url registering
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1389776 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
08185743c1
commit
fa29678c54
|
@ -955,7 +955,7 @@
|
|||
<exclude>org/apache/activemq/store/jdbc/JDBCStoreBrokerTest.*</exclude>
|
||||
<exclude>org/apache/activemq/broker/ft/MasterSlaveSlaveDieTest.*</exclude>
|
||||
<exclude>org/apache/activemq/security/XBeanSecurityWithGuestNoCredentialsOnlyTest.*</exclude>
|
||||
|
||||
<exclude>org/apache/activemq/store/kahadb/plist/PListTest.*</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -62,7 +62,6 @@ public class TransportConnector implements Connector, BrokerServiceAware {
|
|||
private DiscoveryAgent discoveryAgent;
|
||||
private final ConnectorStatistics statistics = new ConnectorStatistics();
|
||||
private URI discoveryUri;
|
||||
private URI connectUri;
|
||||
private String name;
|
||||
private boolean disableAsyncDispatch;
|
||||
private boolean enableStatusMonitor = false;
|
||||
|
@ -105,7 +104,6 @@ public class TransportConnector implements Connector, BrokerServiceAware {
|
|||
public ManagedTransportConnector asManagedConnector(ManagementContext context, ObjectName connectorName) throws IOException, URISyntaxException {
|
||||
ManagedTransportConnector rc = new ManagedTransportConnector(context, connectorName, getServer());
|
||||
rc.setBrokerInfo(getBrokerInfo());
|
||||
rc.setConnectUri(getConnectUri());
|
||||
rc.setDisableAsyncDispatch(isDisableAsyncDispatch());
|
||||
rc.setDiscoveryAgent(getDiscoveryAgent());
|
||||
rc.setDiscoveryUri(getDiscoveryUri());
|
||||
|
@ -345,17 +343,12 @@ public class TransportConnector implements Connector, BrokerServiceAware {
|
|||
}
|
||||
|
||||
public URI getConnectUri() throws IOException, URISyntaxException {
|
||||
if (connectUri == null) {
|
||||
if (server != null) {
|
||||
connectUri = server.getConnectURI();
|
||||
return server.getConnectURI();
|
||||
} else {
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
return connectUri;
|
||||
}
|
||||
|
||||
public void setConnectUri(URI transportUri) {
|
||||
this.connectUri = transportUri;
|
||||
}
|
||||
|
||||
public void onStarted(TransportConnection connection) {
|
||||
connections.add(connection);
|
||||
|
|
|
@ -43,14 +43,14 @@ abstract public class WebTransportServerSupport extends TransportServerSupport {
|
|||
bindHost = (bindHost == null || bindHost.length() == 0) ? "localhost" : bindHost;
|
||||
InetAddress addr = InetAddress.getByName(bindHost);
|
||||
host = addr.getCanonicalHostName();
|
||||
if (addr.isAnyLocalAddress()) {
|
||||
host = InetAddressUtil.getLocalHostName();
|
||||
}
|
||||
|
||||
connector.setHost(host);
|
||||
connector.setPort(bindAddress.getPort());
|
||||
connector.setServer(server);
|
||||
server.addConnector(connector);
|
||||
|
||||
if (addr.isAnyLocalAddress()) {
|
||||
host = InetAddressUtil.getLocalHostName();
|
||||
}
|
||||
setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), host, bindAddress.getPort(), bind.getPath(), bind.getQuery(), bind.getFragment()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@ public class HttpTransportServer extends WebTransportServerSupport {
|
|||
contextHandler.setHandler(gzipHandler);
|
||||
|
||||
server.start();
|
||||
setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), host, connector.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment()));
|
||||
}
|
||||
|
||||
protected void doStop(ServiceStopper stopper) throws Exception {
|
||||
|
|
|
@ -72,7 +72,6 @@ public class WSTransportServer extends WebTransportServerSupport {
|
|||
contextHandler.setAttribute("acceptListener", getAcceptListener());
|
||||
|
||||
server.start();
|
||||
setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), host, connector.getLocalPort(), bind.getPath(), bind.getQuery(), bind.getFragment()));
|
||||
}
|
||||
|
||||
protected void doStop(ServiceStopper stopper) throws Exception {
|
||||
|
|
Loading…
Reference in New Issue