Over a million developers have joined DZone.

Quartz Library Migration After Many Years

DZone's Guide to

Quartz Library Migration After Many Years

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

Weeks ago, the company I'm working at announced that the management decided to upgrade our Spring library we are using from Spring 1.x to Spring 3.0.6. And the task for me was upgrading the Quartz framework from version 1.3.x to 2.1.

The project's actually only been using a narrow set  features available in Quartz so I guessed there would be no big refactoring needed. But unfortunately I was shocked with how big the changes were in Quartz. Looking at the Quartz source code made me realize that our Quartz was wayyyy older than the current 2.1 version. It's been more than 6 years and I was still at university at that time.

Some classes now have become interfaces and there are new ways to instantiate some classes. JobDetail and Trigger are now an interface instead of classes. I used to create JobDetail directly using new and now there is JobBuilder class to create JobDetail. Trigger is now created using TriggerBuilder instead of instantiating using new.

It's also interesting that name and group information for Job and Trigger are wrapped inside JobKey and TriggerKey instead of passing Strings.


But anyway, Spring 3 hasn't supported Quartz 2.x yet  so we decided to upgrade from Quartz 1.3.x to 1.8.5.

Moral of the story.  Don't wait years to upgrade important libraries.

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}