prevent hang if os muiticast is disabled

This commit is contained in:
gtully 2015-01-23 12:02:34 +00:00
parent 981c0f20fa
commit c9c1f587ad
2 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ public class DiscoveryTransportBrokerTest extends NetworkTestSupport {
} }
protected StubConnection createFailoverConnection() throws Exception { protected StubConnection createFailoverConnection() throws Exception {
URI failoverURI = new URI("discovery:" + getDiscoveryUri()); URI failoverURI = new URI("discovery:(" + getDiscoveryUri() + ")?startupMaxReconnectAttempts=5");
Transport transport = TransportFactory.connect(failoverURI); Transport transport = TransportFactory.connect(failoverURI);
StubConnection connection = new StubConnection(transport); StubConnection connection = new StubConnection(transport);
connections.add(connection); connections.add(connection);

View File

@ -64,7 +64,7 @@ public class DiscoveryTransportNoBrokerTest extends CombinationTestSupport {
final int noConnectionToCreate = 10; final int noConnectionToCreate = 10;
for (int i=0; i<10;i++) { for (int i=0; i<10;i++) {
ActiveMQConnectionFactory factory = ActiveMQConnectionFactory factory =
new ActiveMQConnectionFactory("discovery:(multicast://239.255.2.3:6155?group=" + group +")?closeAsync=false"); new ActiveMQConnectionFactory("discovery:(multicast://239.255.2.3:6155?group=" + group +")?closeAsync=false&startupMaxReconnectAttempts=5");
LOG.info("Connecting."); LOG.info("Connecting.");
Connection connection = factory.createConnection(); Connection connection = factory.createConnection();
connection.setClientID("test"); connection.setClientID("test");