mirror of https://github.com/apache/activemq.git
- Updated the config xml to use new discovery syntax.
- Using specific version of activeio as that may change a bit soon. - The vm transport now support specifing a broker config file: vm://localhost?brokerConfig=xbean:/path/to/config/file - Starting the JMX connector was taking a LONG time to start up... so I switch to starting it up async. - The object name for a managed transport connection could be invalid so we now encode the name so that it's not. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@356616 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a558fef374
commit
9b1345bb32
|
@ -25,6 +25,7 @@ import org.activemq.command.Response;
|
|||
import org.activemq.thread.TaskRunnerFactory;
|
||||
import org.activemq.transport.Transport;
|
||||
import org.activemq.util.IOExceptionSupport;
|
||||
import org.activemq.util.JMXSupport;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
@ -116,7 +117,7 @@ public class ManagedTransportConnection extends TransportConnection {
|
|||
Hashtable map = new Hashtable(connectorName.getKeyPropertyList());
|
||||
map.put("Type", "Connection");
|
||||
String jmxConnectionId = ObjectName.quote(connectionId);
|
||||
map.put("Connection", jmxConnectionId);
|
||||
map.put("Connection", JMXSupport.encodeObjectNamePart(connectionId));
|
||||
try {
|
||||
return new ObjectName(connectorName.getDomain(), map);
|
||||
}
|
||||
|
|
|
@ -82,12 +82,18 @@ public class ManagementContext implements Service {
|
|||
getMBeanServer().invoke(namingServiceObjectName, "start", null, null);
|
||||
} catch (Throwable ignore) {
|
||||
}
|
||||
try {
|
||||
connectorServer.start();
|
||||
log.info("JMX consoles can connect to " + connectorServer.getAddress());
|
||||
} catch (IOException e) {
|
||||
log.warn("Failed to start jmx connector: "+e.getMessage());
|
||||
}
|
||||
Thread t = new Thread("JMX connector") {
|
||||
public void run() {
|
||||
try {
|
||||
connectorServer.start();
|
||||
log.info("JMX consoles can connect to " + connectorServer.getAddress());
|
||||
} catch (IOException e) {
|
||||
log.warn("Failed to start jmx connector: "+e.getMessage());
|
||||
}
|
||||
}
|
||||
};
|
||||
t.setDaemon(true);
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,8 +76,13 @@ public class VMTransportFactory extends TransportFactory {
|
|||
try {
|
||||
host = location.getHost();
|
||||
options = URISupport.parseParamters(location);
|
||||
Map brokerOptions = IntrospectionSupport.extractProperties(options, "broker.");
|
||||
brokerURI = new URI("broker://()/"+host+"?"+URISupport.createQueryString(brokerOptions));
|
||||
String config = (String) options.remove("brokerConfig");
|
||||
if( config != null ) {
|
||||
brokerURI = new URI(config);
|
||||
} else {
|
||||
Map brokerOptions = IntrospectionSupport.extractProperties(options, "broker.");
|
||||
brokerURI = new URI("broker://()/"+host+"?"+URISupport.createQueryString(brokerOptions));
|
||||
}
|
||||
} catch (URISyntaxException e1) {
|
||||
throw IOExceptionSupport.create(e1);
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@
|
|||
|
||||
<transportConnectors>
|
||||
<!-- prefixing a connector with discovery: causes the connector to be advertiesed over rendezvous -->
|
||||
<transportConnector uri="discovery:tcp://localhost:61616"/>
|
||||
<transportConnector uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
|
||||
</transportConnectors>
|
||||
|
||||
<networkConnectors>
|
||||
<!-- by default just auto discover the other brokers -->
|
||||
<networkConnector uri="multicast"/>
|
||||
<networkConnector uri="multicast://default"/>
|
||||
<!--
|
||||
<networkConnector uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
|
||||
-->
|
||||
|
|
|
@ -29,19 +29,13 @@
|
|||
</persistenceAdapter>
|
||||
|
||||
<transportConnectors>
|
||||
<!-- prefixing a connector with discovery: causes the connector to be advertiesed over rendezvous -->
|
||||
<!--
|
||||
<transportConnector uri="discovery:tcp://localhost:61616"/>
|
||||
-->
|
||||
<transportConnector uri="tcp://localhost:61616"/>
|
||||
<transportConnector uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
|
||||
</transportConnectors>
|
||||
|
||||
<networkConnectors>
|
||||
<!-- by default just auto discover the other brokers -->
|
||||
<networkConnector uri="rendezvous://default"/>
|
||||
|
||||
<networkConnector uri="multicast://default"/>
|
||||
<!--
|
||||
<networkConnector uri="multicast"/>
|
||||
<networkConnector uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
|
||||
-->
|
||||
</networkConnectors>
|
||||
|
|
|
@ -75,7 +75,7 @@ jmock_cglib_version=1.0.1
|
|||
commons_beanutils_version=1.6.1
|
||||
javacc_version=2.1
|
||||
activecluster_version=1.1-SNAPSHOT
|
||||
activeio_version=2.2-SNAPSHOT
|
||||
activeio_version=2.1
|
||||
drools_core_version=2.0-beta-13
|
||||
xerces_version=2.6.2
|
||||
xml_parser_apis_version=2.2.1
|
||||
|
|
Loading…
Reference in New Issue