-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Messaging rework #538
Messaging rework #538
Conversation
Conflicts: core/roboconf-agent/pom.xml karaf/roboconf-karaf-dist-dm/karaf-resources/net.roboconf.dm.configuration.cfg
Conflicts: core/roboconf-core/src/test/java/net/roboconf/core/utils/UtilsTest.java
Oops! Invalid user... I think invoking |
Seriously, having the units test that fail randmly with the HTTP messaging is not a good sign for its maturity. I cannot determine whether this is due to the test conditions (starting a Jetty server by hand), a concurrency issue, waiting delays or if it is an implementation problem. 😡 The fact is real tests (by hand) worked. |
I updated the messaging tests so that it always works with the HTTP implementation.
... is the normal flow. But sometimes, steps 5 and 6 are reversed. Anyway, I added delays to secure this. |
BTW, I squashed my additional commits to fix tests on Travis. |
OK. After two minor issues, I focused on reworking the messaging. 😈
The client part of the messaging (what is used in the DM and agents) was already good enough (we refactored the code more than 6 times, it is mature enough now). What was complex was creating a new messaging implementation.
I created a new interface for messaging implementation. I also wrote a mediation layer between the messaging's business API and the API for messaging implementation. The messaging API now gathers the business logic used by agents and the DM. and it invokes technical implementations of messaging clients. This part is more simple than before. The iPojo metadata were also simplified.
I then created an in-memory implementation of Roboconf's messaging. It only works when the DM and agents run in the same JVM (e.g. with agents in-memory). I then fetched Pierre-Yves's work on the HTTP messaging. After squashing the commits, I refactored the code to rely on the new extension API. It was tested with in-memory agents and with Docker (IP = 172.17.0.1).
Eventually, I worked on using several messaging implementations in integration tests. It led me to submit a patch to PAX Exam. Although I have to complete it so that it is accepted, I successfully tested these upgrades on Roboconf's integration tests. The AgentInMemory test can easily run with Rabbit MQ, in-memory and HTTP messaging implementations. I commented a part of these modifications until my patch is integrated and hopefully released along with PAX Exam.
Eventually, notice that this PR also solves #487.
It is not volunteer, but refactoring the messaging API bundle resulted in no more NPE during fast reconfigurations (which seemed to be the cause of #487).