FlexyPool 2 has been released

(Last Updated On: January 26, 2018)

Introduction

I’m happy to announce you that FlexyPool 2 has just been released!

FlexyPool 2 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.

FlexyPool 2.0

Thanks to 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.

<flexy-pool.version>2.0.0</flexy-pool.version>

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:

<dependency>
    <groupId>com.vladmihalcea.flexy-pool</groupId>
    <artifactId>flexy-hikaricp</artifactId>
    <version>${flexy-pool.version}</version>
</dependency>

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:

<dependency>
    <groupId>com.vladmihalcea.flexy-pool</groupId>
    <artifactId>flexy-dropwizard3-metrics</artifactId>
    <version>${flexy-pool.version}</version>
</dependency>

And make sure the connection pool-related dependency excludes the flexy-dropwizard-metrics dependency:

<dependency>
    <groupId>com.vladmihalcea.flexy-pool</groupId>
    <artifactId>flexy-hikaricp</artifactId>
    <version>${flexy-pool.version}</version>
    <exclusions>
        <exclusion>
            <groupId>com.vladmihalcea.flexy-pool</groupId>
            <artifactId>flexy-dropwizard-metrics</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Java 8

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-pool.version>1.3.0</flexy-pool.version>

Removals

The 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 CodahaleMetrics, to DropwizardMetrics.

The flexy-pool-core-java7 dependency was also removed since we don’t need it anymore as Java 1.8 is required anyway.

If you enjoyed this article, I bet you are going to love my Book and Video Courses as well.

Conclusion

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.

Subscribe to our Newsletter

* indicates required
10 000 readers have found this blog worth following!

If you subscribe to my newsletter, you'll get:
  • A free sample of my Video Course about running Integration tests at warp-speed using Docker and tmpfs
  • 3 chapters from my book, High-Performance Java Persistence, 
  • a 10% discount coupon for my book. 
Get the most out of your persistence layer!

Advertisements

4 thoughts on “FlexyPool 2 has been released

  1. I think there is an error in the maven dependency sample. It should be dropwizard 4 instead of hirakicp.
    Thanks for your great stuff and for the book as well.

    1. I think there is an error in the maven dependency sample. It should be dropwizard 4 instead of hirakicp.

      No, it’s fine. You don’t need to declare the Dropwizard Metrics 4 dependency if that’s what you want. Just set the connection pool-related one as explained in the Installation Guide.

      Thanks for your great stuff and for the book as well.

      Thanks, I’m glad you liked them.

Leave a Reply

Your email address will not be published. Required fields are marked *