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

   ### Description
   
   **Summary**
   I am using APISIX for JSON transcoding of my gRPC services. I want to be 
able to capture a request parameter from the URL and use it with grpc-transcode.
   
   **Steps to Reproduce**
   
   **1. Created a gRPC service with the following proto definition:**
   
   ```
   syntax = "proto3"; 
   package Campaign;
   service CampaignService {
       rpc CreateCampaign (CreateCampaignRequest) returns 
(CreateCampaignResponse);
       rpc GetCampaign (GetCampaignRequest) returns (GetCampaignResponse);
       rpc DeleteCampaign (DeleteCampaignRequest) returns 
(DeleteCampaignResponse);
       rpc GetCampaigns (GetCampaignsRequest) returns (GetCampaignsResponse);
   }
   ```
   
   **2. Defined a route in APISIX:**
   
   ```
   routes:
     - id: 1
       uri: /api/v1/campaigns/:campaign_id
       methods:
         - GET
       plugins: 
         grpc-transcode:
           proto_id: campaign_proto
           service: Campaign.CampaignService
           method: GetCampaign
           show_status_in_body: true
       upstream_id: campaign_upstream
   ```
   
   **3. The GetCampaignRequest message definition is:**
   
   ```
   message GetCampaignRequest {
       string campaign_id = 1;
   }
   ```
   
   **Expected Behavior**
   I would like the campaign_id from the URL parameter to be used for JSON to 
gRPC transcoding.
   
   **Actual Behavior**
   The campaign_id from the URL is not being used in the gRPC transcode.
   
   **System Information**
   APISIX version: [e.g., 2.8]
   OS: [e.g., Ubuntu 20.04]
   Others: [Additional information if any]
   Additional Context
   How can I use URL parameters like campaign_id in my grpc-transcode 
configuration?
   
   Thank you!
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.4.1 (Standalone Mode)
   - Operating system (run `uname -a`): debian
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 
openresty/1.21.4.1
   - LuaRocks version, for installation issues (run `luarocks --version`):  
3.7.0
   


-- 
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