LangInteger

Archive: 2019

Java 中的 volatile 和 synchronize 关键字解读

Concurrent Patterns and Best Practices,遇到两篇参考文章

一番阅读之后,撰写此文备忘。

Java Html to PDF

百度/必应/谷歌一下,使用 Java 生成 PDF 文档的常用工具为

但是最新的 iText7 使用 AGPL 协议,需要购买 license 才能够合理合法的在商业项目中使用。本着省钱的原则,使用 iText5 进行开发。

Java Bean Validation 及其在 Spring Boot 参数校验中的应用

  • 1 ConstraintViolationException 和 MethodArgumentNotValidException 在参数校验中有何区别?
  • 2 @Valid 和 @Validated 有什么区别?
  • 3 为什么在 Spring Boot 项目中, 各个方法中的 @Valid 注解对 query 参数和 list object 旁边的参数校验注解熟视无睹?
  • 4 为什么在第 3 条的基础上,只要在 Controller 上打上 @Validated 注解,注解中表明的约束又能焕发新生,起到相应的作用?

Building Web Server With Akka HTTP

Philosophy of Akka HTTP quoted from their documentations:

The Akka HTTP modules implement a full server and clientside HTTP stack on top of akka-actor and akka-stream. It’s not a web-framework but rather a more general toolkit for providing and consuming HTTP-based services. While interaction with a browser is of course also in scope it is not the primary focus of Akka HTTP.

Akka HTTP was designed specifically as “not-a-framework”, not because we don’t like frameworks, but for use cases where a framework is not the right choice. Akka HTTP is made for building integration layers based on HTTP and as such tries to “stay on the sidelines”. Therefore you normally don’t build your application “on top of” Akka HTTP, but you build your application on top of whatever makes sense and use Akka HTTP merely for the HTTP integration needs.

centralized-configuration

Spring Cloud 配置中心使用及各配置优先级。

OOP 之殇 —— 从一次事故说起

不久前,在编码系统某业务模块完毕,感觉万事大吉可以放飞自我的时候,测试出一个莫名其妙的 BUG。

1