FlexyPool 2 has been released

Imagine having a tool that can automatically detect JPA and Hibernate performance issues. Wouldn’t that be just awesome?

Well, Hypersistence Optimizer is that tool! And it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, or Play Framework.

So, enjoy spending your time on the things you love rather than fixing performance issues in your production system on a Saturday night!

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.

Seize the deal! 40% discount. Seize the deal! 40% discount. Seize the deal! 40% discount.

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.

Transactions and Concurrency Control eBook

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.