I’m happy to announce you that
FlexyPool 2 has just been released!
I started FlexyPool
in 2014 because, at the time, I was working as a software architect on a large real-estate platform and we were about to launch the system into production. Because the system was split into multiple modules, we needed a way to figure out the right pool size for each module.
To make matters worse, the front-end nodes could be auto-scaled, so we needed monitoring and same fallback mechanisms in case our initial assumptions did not hold anymore.
And that’s how FlexyPool was born.
John Ament, I came to realize that Dropwizard Metrics 4 was launched and it does not work with FlexyPool.
So, while working on adding support for Dropwizard Metrics 4, I realized I need a new major release and so you have it.
After investigating John Ament’s issue a little bit, I realized that Dropwizard Metrics did not rename the
codahale package which
FlexyPool was already prepared for supporting anyway.
However, thanks to the
ServiceLocator mechanism, we can easily support both Dropwizard Metrics 4 and Dropwizard Metrics 3.
Dropwizard Metrics 4
By default, Dropwizard Metrics 4 will be used, so you don’t have to do anything special about it. Just set up the connection pool-related dependency and you are done:
Dropwizard Metrics 3
If you still want to use FlexyPool 2 with Dropwizard Metrics 3 you can still get it working.
First, you need to add the following Maven dependency:
And make sure the connection pool-related dependency excludes the
Because Dropwizard Metrics 4 supports at least Java 1.8, I decided it’s about time I make the same move as well. If you are stuck with Java 1.6 or 1.7, then you can still use the FlexyPool 1.3.0:
flexy-codahale-metrics dependency was removed, but since this was a transitive dependency, you might not need to change anything in your project configuration.
What you might need to change is to change all
Codahale class occurrences, like
flexy-pool-core-java7 dependency was also removed since we don’t need it anymore as Java 1.8 is required anyway.
I'm running an
on the 14th of May about The Best Way to Fetch Data with Java Persistence and Hibernate.
If you enjoyed this article, I bet you are going to love my
and Book as well.
And that’s pretty much it. Everything else should work just like in FlexyPool 1.x so migrating to the 2.0 version should not be very complicated.
Although FlexyPool is a very small open-source framework, it’s still very relevant to the day.