You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/12/24 02:11:23 UTC

[GitHub] [servicecomb-java-chassis] leland17 opened a new issue #1484: query about context delivery mechanism of servicecomb

leland17 opened a new issue #1484: query about context delivery mechanism of servicecomb
URL: https://github.com/apache/servicecomb-java-chassis/issues/1484
 
 
   In my case,  when request arrived at edge service, some properties will be added to the invocation context, so the invocation instance will get the context setted by edge service.
   
   but in the invocation instance, I depend on the other service instance, so how clould I diliver this context by a remote rpc request to a new service instance ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1484: query about context delivery mechanism of servicecomb

Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1484: query about context delivery mechanism of servicecomb
URL: https://github.com/apache/servicecomb-java-chassis/issues/1484#issuecomment-568642794
 
 
   If you send a REST request from a Java-Chassis microservice instance to another Java-Chassis microservice instance, the invocation context will be transferred by the Java-Chassis built-in mechanism, as long as you send the request by Java-Chassis framework.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1484: query about context delivery mechanism of servicecomb

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1484: query about context delivery mechanism of servicecomb
URL: https://github.com/apache/servicecomb-java-chassis/issues/1484#issuecomment-568666716
 
 
   Do you mean 
   ```
     @ApiResponse(code = 200, response = User.class, message = "")
     @ResponseHeaders({@ResponseHeader(name = "h1", response = String.class),
         @ResponseHeader(name = "h2", response = String.class)})
     @Path("/cseResponse")
     @GET
   public Response cseResponse(InvocationContext c1) {
       Response response = Response.createSuccess(Status.ACCEPTED, new User());
       Headers headers = response.getHeaders();
       headers.addHeader("h1", "h1v " + c1.getContext().get(Const.SRC_MICROSERVICE).toString());
   
       InvocationContext c2 = ContextUtils.getInvocationContext();
       headers.addHeader("h2", "h2v " + c2.getContext().get(Const.SRC_MICROSERVICE).toString());
   
       return response;
     }
   ```
   
   or
   
   ```
   void testTraceIdOnContextContainsTraceId() {
       InvocationContext context = new InvocationContext();
       context.addContext(Const.TRACE_ID_NAME, String.valueOf(Long.MIN_VALUE));
       ContextUtils.setInvocationContext(context);
       String traceId = test.testTraceId();
       TestMgr.check(String.valueOf(Long.MIN_VALUE), traceId);
       ContextUtils.removeInvocationContext();
     }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services