Weekly Summary: December 2019 Week 5

2019-12-23

  1.SpringCloud Feign call with {url} when how to deal with such as:? Proxy package interfaces ----- answer: no treatment, how to call it how to call

  

 

   2.SpringFrameWork nice log RBI API,

  StopWatch

  

 

2019-12-24

  1. RestTemplate remote call,

    public static void main(String[] args) {
        String url = String.format("https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s",
                "xxxxxx");
        Map headers=new HashMap<String,String> (16);
        headers.put("Content-Type", "application/json; charset=UTF-8");

        Template Residual rest template = new Rest template builder () build (),.;
        Map<String,Object> params=new HashMap<>(16);
        params.put(WxMsgConstant.TO_USER, "@all");
        params.put(WxMsgConstant.MSG_TYPE,"text");
        params.put(WxMsgConstant.AGENT_ID, 1000002);
        Map<String,String> contentMap =new HashMap<>(16);
        contentMap.put (WxMsgConstant.CONTENT, "the message push, please see" );
        params.put(WxMsgConstant.TEXT, contentMap);

        ResponseEntity<WxMessageResp> entity = restTemplate.postForEntity(url, JSON.toJSONString(params), WxMessageResp.class);

        WxMessageResp body = entity.getBody();
        log.info(body.toString());
    }

2019-12-25

  1.SpringCloud Feign remoting configuration issues:

    Since Feign integrated Ribbon and Hystrix, so the main configuration is also the main two components:

        1. Configure Ribbon, used to obtain the list of services to ensure high availability

        2. Configure Hystrix, to ensure that the entire process Feign called timeout fuse,

          And when configured to ensure that the Hystrix fusing time is greater than the ribbon acquisition time service list and configuration enable hystrix: true,

        3. Note: Feign does not seem to support such a combination comment GetMapping, declared value and the value to be displayed annotations, otherwise it will burst illegalState abnormal

        When 4.Feign remote call, if the method parameter is an entity, you need to provide a default constructor

        5.SpringCloud Feign essentially of encapsulation of RestTemplate

     

 

 

2019-12-31

  1.Xshell copy and paste tips

        Tools -> Options -> Keyboard and "paste clipboard contents" mouse, the middle button configuration

  

 

2019-12-31

  1. Check the log commonly used Linux commands

    For example: The log file is info.20191231.log

    -1. View real-time log tail tail -f info.20191231.log / 100 line of real-time to see the tail of the log tail -100f info.20191231.log

    -2 find a log of all the key characters in the line cat -n info.20191231.log | grep 'key character'

    -3.定位到关键字符所在的行之后,查看该行前后多少行的日志

      例如定位到20000行之后,通常是查看前后10行的日志,因为命令为 sed -n '19990,20010p' info.20191231.log 

 

    

  

Guess you like

Origin www.cnblogs.com/gabriel-y/p/12129943.html