Petals ESB lifecycles

compared with
Current by Victor NOËL
on Nov 04, 2015 16:07.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (3)

View Page History
* [the service-unit life-cyle|#service-unit-lifecycle].

At the bottom of this page, we also explain the interrelation between registering endpoints (usually SU provides, but also components' native services) and processing messages arriving on these endpoints.

{column}
{column:width=35%}
* When deploying a provider service unit, it is registered by the component.
* When initializing a service unit, its resources are allocated.
* When starting a service unit, its provides endpoints are registered, external listening is started and consumptions of services are started.
* When stopping a service unit, its provides endpoints are unregistered, external listening is stopped and consumptions of services are stopped,
* When shutting down a service unit, its resources are released.
We don't really implement that, all endpoints are registered after start, but actually we have no example where this two-phase start is needed... this is not clear!
{petalslink}


h1. Registering endpoints and processing messages for them

On the one hand, once an endpoint is registered, there is the possibility of request messages arriving for it, this is why SUs endpoints are only registered once their SU have been completely started.
On the other hand, when a component is stopped, it stops processing requests, but the endpoints are not unregistered: in that case, the messages are not lost and simply kept in the delivery channel of the component until it is started again.

It is the responsibility of the administrator to not keep a component in a 'STOPPED' state while its SUs are in a 'STARTED' state for too long.

To summarize:
* Message processing is the responsibility of the component lifecycle at the transition between 'STOPPED' and 'STARTED'.
* Registration of SU endpoints is the responsibility of the SU lifecycle at the transition between 'STOPPED' and 'STARTED'.
* For the special case of native services, registration of endpoints is the responsibility of the component lifecycle at the transition between 'SHUTDOWN' and 'STARTED'/'STOPPED'.