We're updating the issue view to help you get more done. 

Component event listeners should fire upon cluster events

Description

The lifecycle of a component can be observed using the event listener defined by org.jivesoftware.openfire.component.ComponentEventListener

When a new cluster node joins a cluster that already has a component, the component effectively becomes available to the new cluster node. As such, the event listeners should be fired.

Note that this applies to regular ('internal') components as well as external components.

Environment

None

Acceptance Test - Entry

Test 1

  1. start cluster node A

  2. start cluster node B

  3. start external component C, connected to A.

Expected result
ComponentEventListener#componentRegistered and componentInfoReceived should be invoked on both cluster nodes.
 
Test 2

  1. start cluster node A

  2. start external component C, connected to A.

  3. start cluster node B

Expected result
ComponentEventListener#componentRegistered and componentInfoReceived should be invoked on cluster node B (and should already have been invoked on cluster node A between steps 2 and 3).

Test 3

  1. start cluster node A

  2. start cluster node B

  3. start external component C, connected to A

  4. shut down external component C

Expected result
Component event 'unregistered' should be triggered on both cluster nodes.
 
Test 4

  1. start cluster node A

  2. start cluster node B

  3. start external component C, connected to A

  4. shut down cluster node A

Expected result
Component event 'unregistered' should be triggered on cluster node B (and ideally, B, just before shutdown).

Activity

Show:
Guus der Kinderen
March 14, 2019, 11:02 AM

Note that there's an omission in the tests associated with this issue: it is acceptable to have the same component be available on more than one cluster node.

The desired behavior in these instances is that event listeners reflect the availability of a component anywhere on the cluster: if more than one instance of the same component connects, only the first connect should trigger 'registered'. When they disconnect, 'unregistered' should be triggered only after the last component disconnects.

Assignee

Guus der Kinderen

Reporter

Guus der Kinderen

Labels

None

Expected Effort

None

Ignite Forum URL

None

Components

Fix versions

Priority

Major
Configure