:bug: Avoid multiple GuiceLocator instances, and handle potential multiple KapuaMessageListeners
Should guicelocator fail at broker startup, multiple instances of (Kapua)MessageListener are istantiated, failing device login due to split request/response maps. In general, guice modules should avoid doing logic, and should avoid failing. Guice cannot guarantee that singleton objects previously instantiated are killed - which in some cases can be very distruptive. This pr both avoids multiple guiceLocator instantiation attempts within a single process, but also puts in place safeguards that ensure that message correlation will continue to work even if there are multiple (Kapua)MessageListener (possibly due to changes in the wiring).
Codecov Report
Attention: Patch coverage is 10.52632% with 34 lines in your changes missing coverage. Please review.
Project coverage is 16.78%. Comparing base (
296efcd) to head (fae4a63). Report is 4 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #4066 +/- ##
=============================================
- Coverage 16.79% 16.78% -0.01%
Complexity 22 22
=============================================
Files 2008 2008
Lines 52210 52229 +19
Branches 4399 4401 +2
=============================================
- Hits 8770 8768 -2
- Misses 43044 43064 +20
- Partials 396 397 +1
| Files | Coverage Δ | |
|---|---|---|
| ...artemis/plugin/security/ArtemisSecurityModule.java | 0.00% <ø> (ø) |
|
| .../kapua/client/security/bean/ResponseContainer.java | 0.00% <ø> (ø) |
|
| ...java/org/eclipse/kapua/commons/jpa/DataSource.java | 93.75% <ø> (ø) |
|
| ...e/kapua/commons/jpa/KapuaEntityManagerFactory.java | 54.34% <ø> (ø) |
|
| .../eclipse/kapua/locator/KapuaLocatorErrorCodes.java | 100.00% <100.00%> (ø) |
|
| ...se/kapua/client/security/ClientSecurityModule.java | 83.33% <0.00%> (-16.67%) |
:arrow_down: |
| ...ua/client/security/ServiceClientMessagingImpl.java | 0.00% <0.00%> (ø) |
|
| .../eclipse/kapua/locator/guice/GuiceLocatorImpl.java | 84.25% <50.00%> (-5.01%) |
:arrow_down: |
| ...n/java/org/eclipse/kapua/locator/KapuaLocator.java | 46.00% <0.00%> (-5.12%) |
:arrow_down: |
| ...se/kapua/client/security/KapuaMessageListener.java | 0.00% <0.00%> (ø) |