private static void encodeBaggageItemsToResponse(NettyHttpResponse response,
                                                         SofaResponse sofaResponse) {
            RpcInvokeContext context = RpcInvokeContext.peekContext();
            if (response == null || context == null ||
                context.getAllResponseBaggage() == null ||
                context.getAllResponseBaggage().isEmpty()) {
                return;
            }

            for (Map.Entry<String, String> entry : context.getAllResponseBaggage().entrySet()) {
                String key = RPC_RESPONSE_BAGGAGE_PREFIX + entry.getKey();
                String value = entry.getValue();
                response.getOutputHeaders().add(key, value);
            }

            BaggageResolver.carryWithResponse(context, sofaResponse);
        }
Encode baggage items from sofa response to http response context

@param response     netty response
@param sofaResponse rpc response holder
tracer/tracer-opentracing-resteasy/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/RestTracerAdapter.java