Boundaries between Services, Filters, and Codecs in Finagle

前端 未结 2 864
旧时难觅i
旧时难觅i 2021-02-03 10:30

Netty, which is used within Finagle, uses a pipeline of \"handlers\" to sequentially process in and out bound data. Netty examples, and included libraries, show various handler

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-03 11:14

    I don't think it should be a decision between codec or filter. Codecs would rather get wrapped in filters.

    As for decision logic, where to place it, would depend on the decisions that has to be made. Business decisions should go with your business logic, while some decisions like routing, load balancing, certain types of access control, etc. could fit in well as a filter.

    Services are typically sit at the end of the line, and Finagle with it's filters will get you there.

    Don't know if this makes sense?

    Just step away from the technical detail for a moment, and look at the logic. What should be responsible for what, and then get the technology to fit your design. Don't bend your design too much to fit the technology.

    By the way, I've implemented a gateway server on top of Finagle, and I must say: It's a nice library to work with.

    I don't know what you are trying to build, but have a look at possible alternatives also: Spray, Blueeyes, Unfiltered, Play-Mini, etc. It may help you get a better understanding of what goes where.

提交回复
热议问题