Skip to content

Commit e5d48ba

Browse files
committed
Remove documentation sections covered on the website
References rabbitmq/rabbitmq-website#2059
1 parent a968c69 commit e5d48ba

File tree

1 file changed

+0
-78
lines changed

1 file changed

+0
-78
lines changed

src/docs/asciidoc/usage.adoc

-78
Original file line numberDiff line numberDiff line change
@@ -26,84 +26,6 @@ include::{test-examples}/Api.java[tag=connection-settings]
2626
<1> Use the `guest` user by default
2727
<2> Use the `admin` user for this connection
2828

29-
[[lifecycle-listeners]]
30-
=== Lifecycle Listeners
31-
32-
It is possible to add one or several listeners when creating a `Connection` instance:
33-
34-
.Setting a listener on a connection
35-
[source,java,indent=0]
36-
--------
37-
include::{test-examples}/Api.java[tag=listener-connection]
38-
--------
39-
<1> Setting a listener
40-
<2> The previous state of the connection
41-
<3> The current (new) state of the connection
42-
<4> The cause of the failure (in case of failure)
43-
<5> The connection instance (as a `Resource`)
44-
45-
It is also possible to set listeners on publisher instances:
46-
47-
.Setting a listener on a publisher
48-
[source,java,indent=0]
49-
--------
50-
include::{test-examples}/Api.java[tag=listener-publisher]
51-
--------
52-
<1> Setting a listener
53-
54-
And on consumer instances as well:
55-
56-
.Setting a listener on a consumer
57-
[source,java,indent=0]
58-
--------
59-
include::{test-examples}/Api.java[tag=listener-consumer]
60-
--------
61-
<1> Setting a listener
62-
63-
The listener API is the same for connection, publishers, and consumers.
64-
They all implement the {javadoc-url}/com/rabbitmq/client/amqp/Resource.html[`Resource`] marker interface.
65-
The {javadoc-url}/com/rabbitmq/client/amqp/Resource.StateListener.html[`StateListener`] interface has only one method that takes a {javadoc-url}/com/rabbitmq/client/amqp/Resource.Context.html[`Context`] argument.
66-
See the snippet above for the information available in the `Context`.
67-
68-
A resource {javadoc-url}/com/rabbitmq/client/amqp/Resource.State.html[`State`] can have the following values: `OPENING`, `OPEN`, `RECOVERING`, `CLOSING`, `CLOSED`.
69-
70-
=== Recovery
71-
72-
Automatic connection recovery is activated by default: the client will automatically restore a connection after an unexpected closing (e.g. network glitch, node restart, etc).
73-
Automatic topology recovery is also activated as soon as connection recovery is: the client will recreate AMQP entities, as well as publishers and consumers for the recovering connection.
74-
Developers have less to worry about network stability and node restart, as the client will take care of it.
75-
76-
The client tries to reconnect every 5 seconds until it succeeds.
77-
It is possible to change this behavior by providing a custom {javadoc-url}/com/rabbitmq/client/amqp/BackOffDelayPolicy.html[`BackOffDelayPolicy`]:
78-
79-
.Setting a back-off policy for connection recovery
80-
[source,java,indent=0]
81-
--------
82-
include::{test-examples}/Api.java[tag=connection-recovery-back-off]
83-
--------
84-
<1> Configure recovery
85-
<2> Set the back-off delay policy
86-
87-
It is also possible to deactivate topology recovery if it is not appropriate for a given application.
88-
The application would usually register a connection <<lifecycle-listeners,lifecycle listener>> to know when the connection is recovered and recover its own state accordingly.
89-
90-
.Deactivating topology recovery
91-
[source,java,indent=0]
92-
--------
93-
include::{test-examples}/Api.java[tag=connection-recovery-no-topology-recovery]
94-
--------
95-
<1> Deactivate topology recovery
96-
<2> Restore application state when connection is recovered
97-
98-
It is also possible to deactivate recovery altogether:
99-
100-
.Deactivating recovery
101-
[source,java,indent=0]
102-
--------
103-
include::{test-examples}/Api.java[tag=connection-recovery-deactivate]
104-
--------
105-
<1> Deactivate recovery
106-
10729
=== Metrics Collection
10830

10931
The library provides the {javadoc-url}/com/rabbitmq/client/amqp/metrics/MetricsCollector.html[`MetricsCollector`] abstraction to collect metrics.

0 commit comments

Comments
 (0)