snowleopard331 opened a new issue, #11260:
URL: https://github.com/apache/apisix/issues/11260

   ### Description
   
   
我想使用http+pb的方式进行请求,但是打开grpc-transcode插件后,无论json/pb都可以请求到,但是返回的始终是json,我的需求是返回pb。请求头中的accept也设置过,但是都没用,以下是我的路由配置:
   
   {
     "uri": "/HelloWorld",
     "name": "HelloWorld",
     "desc": "HelloWorld接口,测试连通性",
     "methods": [
       "POST"
     ],
     "plugins": {
       "elasticsearch-logger": {
         "batch_max_size": 1000,
         "buffer_duration": 60,
         "endpoint_addr": "http://192.168.27.8:9200";,
         "field": {
           "index": "apisixlog"
         },
         "inactive_timeout": 5,
         "max_retry_count": 0,
         "name": "elasticsearch-logger",
         "retry_delay": 1,
         "ssl_verify": true,
         "timeout": 10
       },
       "grpc-transcode": {
         "_meta": {
           "disable": false
         },
         "deadline": 0,
         "method": "HelloWorld",
         "pb_option": [
           "enum_as_name",
           "int64_as_number",
           "no_default_values",
           "disable_hooks"
         ],
         "proto_id": "xxxxxxxxxxxx",
         "service": "xxxxxxxxxx",
         "show_status_in_body": false
       },
       "jwt-auth": {
         "_meta": {
           "disable": true
         },
         "cookie": "jwt",
         "header": "authorization",
         "hide_credentials": false,
         "query": "jwt"
       }
     },
     "upstream": {
       "retries": 3,
       "timeout": {
         "connect": 6,
         "send": 6,
         "read": 6
       },
       "type": "chash",
       "hash_on": "header",
       "key": "USERID",
       "scheme": "grpc",
       "discovery_type": "nacos",
       "discovery_args": {
         "group_name": "xxxxxxxxx",
         "namespace_id": "xxxxxxxxxxxxx"
       },
       "pass_host": "pass",
       "service_name": "providers:kiwi.domainServer.example::",
       "keepalive_pool": {
         "idle_timeout": 60,
         "requests": 1000,
         "size": 320
       },
       "retry_timeout": 1
     },
     "status": 1
   }
   
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):3.6.0
   - Operating system (run `uname -a`): Linux localhost.localdomain 
4.18.0-513.9.1.el8_9.x86_64 #1 SMP Wed Nov 29 18:55:19 UTC 2023 x86_64 x86_64 
x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to