- 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:
Hiram R. Chirino 2005-12-13 21:02:04 +00:00
parent a558fef374
commit 9b1345bb32
6 changed files with 27 additions and 21 deletions

View File

@ -25,6 +25,7 @@ import org.activemq.command.Response;
import org.activemq.thread.TaskRunnerFactory; import org.activemq.thread.TaskRunnerFactory;
import org.activemq.transport.Transport; import org.activemq.transport.Transport;
import org.activemq.util.IOExceptionSupport; import org.activemq.util.IOExceptionSupport;
import org.activemq.util.JMXSupport;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -116,7 +117,7 @@ public class ManagedTransportConnection extends TransportConnection {
Hashtable map = new Hashtable(connectorName.getKeyPropertyList()); Hashtable map = new Hashtable(connectorName.getKeyPropertyList());
map.put("Type", "Connection"); map.put("Type", "Connection");
String jmxConnectionId = ObjectName.quote(connectionId); String jmxConnectionId = ObjectName.quote(connectionId);
map.put("Connection", jmxConnectionId); map.put("Connection", JMXSupport.encodeObjectNamePart(connectionId));
try { try {
return new ObjectName(connectorName.getDomain(), map); return new ObjectName(connectorName.getDomain(), map);
} }

View File

@ -82,12 +82,18 @@ public class ManagementContext implements Service {
getMBeanServer().invoke(namingServiceObjectName, "start", null, null); getMBeanServer().invoke(namingServiceObjectName, "start", null, null);
} catch (Throwable ignore) { } catch (Throwable ignore) {
} }
try { Thread t = new Thread("JMX connector") {
connectorServer.start(); public void run() {
log.info("JMX consoles can connect to " + connectorServer.getAddress()); try {
} catch (IOException e) { connectorServer.start();
log.warn("Failed to start jmx connector: "+e.getMessage()); 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();
} }
} }

View File

@ -76,8 +76,13 @@ public class VMTransportFactory extends TransportFactory {
try { try {
host = location.getHost(); host = location.getHost();
options = URISupport.parseParamters(location); options = URISupport.parseParamters(location);
Map brokerOptions = IntrospectionSupport.extractProperties(options, "broker."); String config = (String) options.remove("brokerConfig");
brokerURI = new URI("broker://()/"+host+"?"+URISupport.createQueryString(brokerOptions)); 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) { } catch (URISyntaxException e1) {
throw IOExceptionSupport.create(e1); throw IOExceptionSupport.create(e1);
} }

View File

@ -32,12 +32,12 @@
<transportConnectors> <transportConnectors>
<!-- prefixing a connector with discovery: causes the connector to be advertiesed over rendezvous --> <!-- 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> </transportConnectors>
<networkConnectors> <networkConnectors>
<!-- by default just auto discover the other brokers --> <!-- by default just auto discover the other brokers -->
<networkConnector uri="multicast"/> <networkConnector uri="multicast://default"/>
<!-- <!--
<networkConnector uri="static://(tcp://host1:61616,tcp://host2:61616)"/> <networkConnector uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
--> -->
@ -46,4 +46,4 @@
</broker> </broker>
</beans> </beans>

View File

@ -29,19 +29,13 @@
</persistenceAdapter> </persistenceAdapter>
<transportConnectors> <transportConnectors>
<!-- prefixing a connector with discovery: causes the connector to be advertiesed over rendezvous --> <transportConnector uri="tcp://localhost:61616" discoveryUri="multicast://default"/>
<!--
<transportConnector uri="discovery:tcp://localhost:61616"/>
-->
<transportConnector uri="tcp://localhost:61616"/>
</transportConnectors> </transportConnectors>
<networkConnectors> <networkConnectors>
<!-- by default just auto discover the other brokers --> <!-- 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)"/> <networkConnector uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
--> -->
</networkConnectors> </networkConnectors>

View File

@ -75,7 +75,7 @@ jmock_cglib_version=1.0.1
commons_beanutils_version=1.6.1 commons_beanutils_version=1.6.1
javacc_version=2.1 javacc_version=2.1
activecluster_version=1.1-SNAPSHOT activecluster_version=1.1-SNAPSHOT
activeio_version=2.2-SNAPSHOT activeio_version=2.1
drools_core_version=2.0-beta-13 drools_core_version=2.0-beta-13
xerces_version=2.6.2 xerces_version=2.6.2
xml_parser_apis_version=2.2.1 xml_parser_apis_version=2.2.1