origin

My previous company needed to call many third-party HTTP interfaces in the Java background, such as wechat Pay, Umeng and other third-party platforms. Many internal services are written in the world’s best languages, and the interfaces can only be called through HTTP interfaces. So accumulate over a long period of time, in Java code there are many various HTTP call interfaces, and call methods are not unified, there are HttpClient written, there are OkHttp written, there are their own packaging, light inside the company different people packaging HTTP tool classes there are two or three. And THE URL is basically written dead in the code, it is difficult to maintain, different interfaces and different transmission methods of parameters, there are GET, POST, JSON transmission, XML transmission. When you have an interface that needs to be modified, it takes half a day just to figure out where the code is.

start

So I wondered if I could encapsulate all of Java’s HTTP interfaces into a unified interface that decouple HTTP information from business code, so that interface callers need to care about the details of sending HTTP requests, and just focus on what the interface itself does. As with RPC interfaces like Dubbo, the request caller simply calls a plain Java method on a plain Java interface object, passing in a Java primitive type or object as a parameter value, and returning a Java object as a return value, all without feeling HTTP. All HTTP-related information is annotated on interfaces and methods, just as in JPA, when maintaining HTTP interfaces.

Then, I started writing Forest in 2015, not knowing about Feign at that point, either Retrofit (^▽^). The so-called ignorant person was fearless. It didn’t take long to complete the first version of the book, and it was successfully promoted within the company. Despite the various bugs in the early version, everyone still responded with one word: incense.

  • Dt_flys.geitee. IO/Forest-webs…
  • Gitee address: gitee.com/dt_flys/for…

challenge

This led me to open source in 2016, and it reached 100 stars in three days on Gitee. However, I did not know how to promote and maintain an open source community at that time, so the growth of star number was not able to continue.

I also learned that Feign and Retrofit existed, which was a bit of a shock to me, and I gave up Forest for a while.

transit

However, DURING this period of time, I have been using Forest in the company’s production environment, and I have been tinkering with the feedback of my colleagues (after all, I am responsible for what I wrote), but because of this, Forest has gradually matured and stabilized. At the same time, with the encouragement of my colleagues, I also came up with Forest’s own development route: Replace HttpClient and OkHttp and differentiate Retrofit and Feign from Retrofit by integrating better with SpringBoot, targeting more third-party HTTP interfaces than Feign, and having a complete Chinese documentation, Chinese community, It is convenient for domestic developers to solve problems.

The status quo

So far, I picked up Forest again in the second half of this year and kept iterating. Since July this year, I have gained 500+ star. Although it is nothing compared with well-known projects with thousands of stars, it is also a great encouragement to me and makes me gradually understand how to do an open source project well. In the future, I will write some open source thoughts (feelings of doing open source).