Subscriptions have a specific lifecycle with
a set of states and related properties. Its
important to understand these states as well
as their transitions.
Subscriptions cannot be modified once
created. In order to "change" a
subscription, you must cancel the existing
subscription and create a new one. Once a
cannot return to any other state.
Once allocated, listeners will
attempt to reconnect until the subscription
is canceled. However state transitions
only happen under certain conditions.
When a subscription is created it is defaulted
PENDING state. This means that
a listener has not been allocated yet. In the event
that a listener cannot obtained, you would not be
charged while a subscription remains in this state.
In this state, a listener has been allocated for your
subscription and begins the connection process. The
subscription will remain in this state until a successful
connection has been made to the resource. This
state can also be rentered in the event that the
connection is dropped.
Once a listener has succesfully connected to the
endpoint, it enters the
state. In this state the listener receives messages
and forwards them to your http endpoint.
the event that a connection drops, the listener will
attempt to reconnect while in this state. If
after 5 attempts a connection cannot be made, the
subscription will transtion back to the
state. This is intended to prevent trashing
between the connecting and listening states.
When a subscription is canceled, it reaches the
CANCELED state. This state is an
end state. This means once a subscription is canceled
it cannnot transition to any other state. The
subscription enters this state immediately when it is
canceled. Subsequently Antenny closes and cleans up
any listener allocated to this subscription.