Skip to content

Commit ed84f97

Browse files
author
Steve Powell
committed
Add newConnection() public methods for backwards compatibility
1 parent 2dc1aea commit ed84f97

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,25 @@ protected void configureSocket(Socket socket) throws IOException{
464464
socket.setTcpNoDelay(true);
465465
}
466466

467+
/**
468+
* Create a new broker connection
469+
* @param addrs an array of known broker addresses (hostname/port pairs) to try in order
470+
* @return an interface to the connection
471+
* @throws IOException if it encounters a problem
472+
*/
473+
public Connection newConnection(Address[] addrs) throws IOException {
474+
return newConnection(Executors.newFixedThreadPool(this.numConsumerThreads),
475+
addrs);
476+
}
477+
467478
/**
468479
* Create a new broker connection
469480
* @param executor thread execution service for consumers on the connection
470481
* @param addrs an array of known broker addresses (hostname/port pairs) to try in order
471482
* @return an interface to the connection
472483
* @throws IOException if it encounters a problem
473484
*/
474-
private Connection newConnection(ExecutorService executor, Address[] addrs)
485+
public Connection newConnection(ExecutorService executor, Address[] addrs)
475486
throws IOException
476487
{
477488
IOException lastException = null;

0 commit comments

Comments
 (0)