You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Serhii (Jira)" <ji...@apache.org> on 2020/01/22 13:33:00 UTC

[jira] [Updated] (THRIFT-5073) Golang: Interceptor for processor handler

     [ https://issues.apache.org/jira/browse/THRIFT-5073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Serhii updated THRIFT-5073:
---------------------------
    Description: 
Hi.

Thank for this great project. But I think we can introduce some improvements which will be are useful for other developers.

Inspired by https://github.com/grpc/grpc-go/blob/master/examples/features/interceptor/server/main.go.

Interceptors give opportunities for:

* Logging input request and response
* We can log panic situation and return TApplicationException to client instead of EOF.
* We can intercept request and do stuff like some validation, etc.

Usage example: https://gist.github.com/voodoo-dn/6af6cf54b8145cc3d4d87d888c4bf907

Pull request: https://github.com/apache/thrift/pull/1991

  was:
Hi.

Thank for this great project. But I think we can introduce some improvements which will be are useful for other developers.

Inspired by https://github.com/grpc/grpc-go/blob/master/examples/features/interceptor/server/main.go.

Interceptors give opportunities for:

Logging input request and response
We can log panic situation and return TApplicationException to client instead of EOF.
We can intercept request and do stuff like some validation, etc.
Usage example: https://gist.github.com/voodoo-dn/6af6cf54b8145cc3d4d87d888c4bf907

Pull request: https://github.com/apache/thrift/pull/1991


> Golang: Interceptor for processor handler
> -----------------------------------------
>
>                 Key: THRIFT-5073
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5073
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Compiler
>    Affects Versions: 0.13.0
>            Reporter: Serhii
>            Priority: Major
>
> Hi.
> Thank for this great project. But I think we can introduce some improvements which will be are useful for other developers.
> Inspired by https://github.com/grpc/grpc-go/blob/master/examples/features/interceptor/server/main.go.
> Interceptors give opportunities for:
> * Logging input request and response
> * We can log panic situation and return TApplicationException to client instead of EOF.
> * We can intercept request and do stuff like some validation, etc.
> Usage example: https://gist.github.com/voodoo-dn/6af6cf54b8145cc3d4d87d888c4bf907
> Pull request: https://github.com/apache/thrift/pull/1991



--
This message was sent by Atlassian Jira
(v8.3.4#803005)