Skip to content

Commit b4480f4

Browse files
Merge branch 'stable'
2 parents 6ec69a8 + 271b856 commit b4480f4

File tree

4 files changed

+56
-9
lines changed

4 files changed

+56
-9
lines changed

src/com/rabbitmq/client/Channel.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ public interface Channel extends ShutdownNotifier {
8686
void close(int closeCode, String closeMessage) throws IOException, TimeoutException;
8787

8888
/**
89-
* Indicates whether the server has asked this client to stop
90-
* sending content-bearing commands (such as basic.publish) by
91-
* issueing a channel.flow{active=false}.
89+
* Deprecated, superseded by TCP back pressure.
90+
* @deprecated
91+
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
9292
*/
9393
boolean flowBlocked();
9494

@@ -130,12 +130,18 @@ public interface Channel extends ShutdownNotifier {
130130

131131
/**
132132
* Add a {@link FlowListener}.
133+
* Deprecated, superseded by TCP back pressure.
134+
* @deprecated
135+
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
133136
* @param listener the listener to add
134137
*/
135138
void addFlowListener(FlowListener listener);
136139

137140
/**
138141
* Remove a {@link FlowListener}.
142+
* Deprecated, superseded by TCP back pressure.
143+
* @deprecated
144+
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
139145
* @param listener the listener to remove
140146
* @return <code><b>true</b></code> if the listener was found and removed,
141147
* <code><b>false</b></code> otherwise
@@ -144,6 +150,9 @@ public interface Channel extends ShutdownNotifier {
144150

145151
/**
146152
* Remove all {@link FlowListener}s.
153+
* Deprecated, superseded by TCP back pressure.
154+
* @deprecated
155+
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
147156
*/
148157
void clearFlowListeners();
149158

src/com/rabbitmq/client/Connection.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ public interface Connection extends ShutdownNotifier { // rename to AMQPConnecti
101101

102102
/**
103103
* Create a new channel, using an internally allocated channel number.
104+
* If <a href="http://www.rabbitmq.com/api-guide.html#recovery">automatic connection recovery</a>
105+
* is enabled, the channel returned by this method will be {@link Recoverable}.
106+
*
104107
* @return a new channel descriptor, or null if none is available
105108
* @throws IOException if an I/O problem is encountered
106109
*/

src/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,16 +530,19 @@ public void useSslProtocol(SSLContext context)
530530
}
531531

532532
/**
533-
* Returns true if automatic connection recovery is enabled, false otherwise
533+
* Returns true if <a href="http://www.rabbitmq.com/api-guide.html#recovery">automatic connection recovery</a>
534+
* is enabled, false otherwise
534535
* @return true if automatic connection recovery is enabled, false otherwise
536+
* @see <a href="http://www.rabbitmq.com/api-guide.html#recovery">Automatic Recovery</a>
535537
*/
536538
public boolean isAutomaticRecoveryEnabled() {
537539
return automaticRecovery;
538540
}
539541

540542
/**
541-
* Enables or disables automatic connection recovery
543+
* Enables or disables <a href="http://www.rabbitmq.com/api-guide.html#recovery">automatic connection recovery</a>.
542544
* @param automaticRecovery if true, enables connection recovery
545+
* @see <a href="http://www.rabbitmq.com/api-guide.html#recovery">Automatic Recovery</a>
543546
*/
544547
public void setAutomaticRecoveryEnabled(boolean automaticRecovery) {
545548
this.automaticRecovery = automaticRecovery;
@@ -548,6 +551,7 @@ public void setAutomaticRecoveryEnabled(boolean automaticRecovery) {
548551
/**
549552
* Returns true if topology recovery is enabled, false otherwise
550553
* @return true if topology recovery is enabled, false otherwise
554+
* @see <a href="http://www.rabbitmq.com/api-guide.html#recovery">Automatic Recovery</a>
551555
*/
552556
@SuppressWarnings("unused")
553557
public boolean isTopologyRecoveryEnabled() {
@@ -557,6 +561,7 @@ public boolean isTopologyRecoveryEnabled() {
557561
/**
558562
* Enables or disables topology recovery
559563
* @param topologyRecovery if true, enables topology recovery
564+
* @see <a href="http://www.rabbitmq.com/api-guide.html#recovery">Automatic Recovery</a>
560565
*/
561566
public void setTopologyRecoveryEnabled(boolean topologyRecovery) {
562567
this.topologyRecovery = topologyRecovery;
@@ -567,7 +572,13 @@ protected FrameHandlerFactory createFrameHandlerFactory() throws IOException {
567572
}
568573

569574
/**
570-
* Create a new broker connection
575+
* Create a new broker connection, picking the first available address from
576+
* the list.
577+
*
578+
* If <a href="http://www.rabbitmq.com/api-guide.html#recovery">automatic connection recovery</a>
579+
* is enabled, the connection returned by this method will be {@link Recoverable}. Future
580+
* reconnection attempts will pick a random accessible address from the provided list.
581+
*
571582
* @param addrs an array of known broker addresses (hostname/port pairs) to try in order
572583
* @return an interface to the connection
573584
* @throws IOException if it encounters a problem
@@ -577,11 +588,18 @@ public Connection newConnection(Address[] addrs) throws IOException {
577588
}
578589

579590
/**
580-
* Create a new broker connection
591+
* Create a new broker connection, picking the first available address from
592+
* the list.
593+
*
594+
* If <a href="http://www.rabbitmq.com/api-guide.html#recovery">automatic connection recovery</a>
595+
* is enabled, the connection returned by this method will be {@link Recoverable}. Future
596+
* reconnection attempts will pick a random accessible address from the provided list.
597+
*
581598
* @param executor thread execution service for consumers on the connection
582599
* @param addrs an array of known broker addresses (hostname/port pairs) to try in order
583600
* @return an interface to the connection
584601
* @throws java.io.IOException if it encounters a problem
602+
* @see <a href="http://www.rabbitmq.com/api-guide.html#recovery">Automatic Recovery</a>
585603
*/
586604
public Connection newConnection(ExecutorService executor, Address[] addrs)
587605
throws IOException
@@ -617,7 +635,12 @@ public ConnectionParams params(ExecutorService executor) {
617635
}
618636

619637
/**
620-
* Create a new broker connection
638+
* Create a new broker connection.
639+
*
640+
* If <a href="http://www.rabbitmq.com/api-guide.html#recovery">automatic connection recovery</a>
641+
* is enabled, the connection returned by this method will be {@link Recoverable}. Reconnection
642+
* attempts will always use the address configured on {@link ConnectionFactory}.
643+
*
621644
* @return an interface to the connection
622645
* @throws IOException if it encounters a problem
623646
*/
@@ -628,7 +651,12 @@ public Connection newConnection() throws IOException {
628651
}
629652

630653
/**
631-
* Create a new broker connection
654+
* Create a new broker connection.
655+
*
656+
* If <a href="http://www.rabbitmq.com/api-guide.html#recovery">automatic connection recovery</a>
657+
* is enabled, the connection returned by this method will be {@link Recoverable}. Reconnection
658+
* attempts will always use the address configured on {@link ConnectionFactory}.
659+
*
632660
* @param executor thread execution service for consumers on the connection
633661
* @return an interface to the connection
634662
* @throws IOException if it encounters a problem

src/com/rabbitmq/client/Recoverable.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
/**
44
* Provides a way to register (network, AMQP 0-9-1) connection recovery
55
* callbacks.
6+
*
7+
* When connection recovery is enabled via {@link ConnectionFactory},
8+
* {@link ConnectionFactory#newConnection()} and {@link Connection#createChannel()}
9+
* return {@link Recoverable} connections and channels.
10+
*
11+
* @see com.rabbitmq.client.impl.recovery.AutorecoveringConnection
12+
* @see com.rabbitmq.client.impl.recovery.AutorecoveringChannel
613
*/
714
public interface Recoverable {
815
/**

0 commit comments

Comments
 (0)