Add option to turn on an OpenWire TCP endpoint.

This commit is contained in:
Timothy Bish 2014-05-15 11:58:49 -04:00
parent ff64b14bc7
commit b83a3d4388

View File

@ -64,6 +64,7 @@ public class AmqpTestSupport {
protected int sslPort; protected int sslPort;
protected int nioPort; protected int nioPort;
protected int nioPlusSslPort; protected int nioPlusSslPort;
protected int openwirePort;
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
final AmqpTestSupport s = new AmqpTestSupport(); final AmqpTestSupport s = new AmqpTestSupport();
@ -123,6 +124,12 @@ public class AmqpTestSupport {
protected void addAMQPConnector() throws Exception { protected void addAMQPConnector() throws Exception {
TransportConnector connector = null; TransportConnector connector = null;
if (isUseOpenWireConnector()) {
connector = brokerService.addConnector(
"tcp://0.0.0.0:" + openwirePort);
openwirePort = connector.getConnectUri().getPort();
LOG.debug("Using openwire port " + openwirePort);
}
if (isUseTcpConnector()) { if (isUseTcpConnector()) {
connector = brokerService.addConnector( connector = brokerService.addConnector(
"amqp://0.0.0.0:" + port + "?transport.transformer=" + getAmqpTransformer()); "amqp://0.0.0.0:" + port + "?transport.transformer=" + getAmqpTransformer());
@ -149,6 +156,10 @@ public class AmqpTestSupport {
} }
} }
protected boolean isUseOpenWireConnector() {
return false;
}
protected boolean isUseTcpConnector() { protected boolean isUseTcpConnector() {
return true; return true;
} }