简体   繁体   中英

Netty Pipeline object parsing

Currently I have a single handler at the end of my netty pipeline that does almost all the request logic. (Parsing a object from json using jackson, authentication, rate limiting, etc. Would it be a better use of the pipeline structure to put these at stages along the pipeline after the executer?

It's matter of re-usability etc. Often you have a handler for decoding, one for encoding and one for the business logic. This allows for better re-usability and also for easier testing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM