rainwolf01 commented on issue #10123:
URL: https://github.com/apache/dubbo/issues/10123#issuecomment-1148136023
感谢大佬百忙中指点。
```java
//from
org.apache.dubbo.rpc.protocol.tri.stream.StreamUtils#convertAttachment
/**
* Convert each user's attach value to metadata
*
* @param headers outbound headers
* @param key metadata key
* @param v metadata value (Metadata Only string and byte arrays
are allowed)
*/
private static void convertSingleAttachment(DefaultHttp2Headers headers,
String key, Object v) {
try {
if (v instanceof String || v instanceof Number || v instanceof
Boolean) {
String str = v.toString();
headers.set(key, str);
} else if (v instanceof byte[]) {
String str = encodeBase64ASCII((byte[]) v);
headers.set(key + TripleConstant.HEADER_BIN_SUFFIX, str);
}
} catch (Throwable t) {
LOGGER.warn("Meet exception when convert single attachment key:"
+ key + " value=" + v,
t);
}
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]