mufiye commented on issue #9999:
URL: https://github.com/apache/skywalking/issues/9999#issuecomment-1375574537
> ContextCarrier is a shell, you could consider a thing similar or lambda as
parameters. Each RPC/MQ has different parameters, so we need a general way to
provide abstract APIs.
I think about how to provide the abstract APIs for injecting/capturing data
processed by `ContextCarrier` to/from all kinds of messages. In my opinion, the
core part code is as below statements.
```java
// in asynchttpclient-2.x-plugin
final HttpHeaders headers = httpRequest.getHeaders();
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
headers.set(next.getHeadKey(), next.getHeadValue());
}
```
Originally, I want to release this part code of RPC/MQ inside the `inject`
and `extract` toolkit-api. But now, as you say, each RPC/MQ has different
parameters, so I think maybe exposing the `items()` in `ContextCarrier`,
`hasNext()` and `next()` in `CarrierItem` as the "Ref" format is better. So
users can use these APIs freely to pass data by all kinds of messages such as
HTTP headers, RPC metadata and so on. I'm not sure it's a reasonable idea.
Could you give some suggestions? @wu-sheng
--
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]