private com.alipay.remoting.InvokeContext getBoltInvokeCtx(final InvokeContext ctx) {
        com.alipay.remoting.InvokeContext boltCtx;
        if (ctx == null) {
            boltCtx = new com.alipay.remoting.InvokeContext();
            boltCtx.put(com.alipay.remoting.InvokeContext.BOLT_CRC_SWITCH, this.opts.isEnableRpcChecksum());
            return boltCtx;
        }

        boltCtx = ctx.get(BOLT_CTX);
        if (boltCtx != null) {
            return boltCtx;
        }

        boltCtx = new com.alipay.remoting.InvokeContext();
        for (Map.Entry<String, Object> entry : ctx.entrySet()) {
            boltCtx.put(entry.getKey(), entry.getValue());
        }
        final Boolean crcSwitch = ctx.get(InvokeContext.CRC_SWITCH);
        if (crcSwitch != null) {
            boltCtx.put(com.alipay.remoting.InvokeContext.BOLT_CRC_SWITCH, crcSwitch);
        }
        return boltCtx;
    }
Bolt rpc client impl.

@author jiachun.fjc
jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/impl/BoltRpcClient.java