Category:Java

  • Spring advanced annotation

    Time:2019-12-9

    Catalog: 1. Use limited notes;2. User defined notes;3. User defined bean life cycle; Development environment: IntelliJ idea February 2, 2019Spring boot version: 2.1.8Create a new spring boot project named demo. I. limited notes When there are multiple beans of the same type, the primary annotation can be used to specify the bean to be injected […]

  • The method of accumulating the number of songs to be listened to by java + selenium Netease cloud music brush

    Time:2019-12-9

    background It should have been last year. Brush Zhihu saw a question about how to brush the accumulated number of songs that Netease cloud music individuals listened to. Then he had a highly praised answer, posted a section of JS code, and executed it directly in the browser console. At that time, I tried it […]

  • https://mp.weixin.qq.com/s/mt8bVpM57SsI-nvTRKxSKg

    Time:2019-12-8

    Interview questions How to deal with ID PK after sub database and sub table? Psychological analysis of interviewers In fact, this is a problem you must face after the sub database and sub table. How to generate the ID? Because if you divide a table into several tables and each table is accumulated from 1, […]

  • Learn more about groovy and scala classes in Java

    Time:2019-12-8

    Preface Java inherits the platform, not the language. There are more than 200 languages that can run on a JVM, and inevitably one of them will eventually replace the Java language as the best way to write a JVM program. This series will explore three next-generation JVM languages: groovy, Scala and clojure, and compare and […]

  • On the application of constructors

    Time:2019-12-7

    I didn’t know where I could use it when I started to learn the constructor. Until I wrote a bookmark application a few days ago, it involved the function of adding bookmarks. This is the general idea, Click the Add Bookmark button, first insert an empty bookmark data into the database, of course, the ID […]

  • Simple understanding of Java functional coding structure and its advantages

    Time:2019-12-7

    Preface When garbage collection becomes the mainstream, it eliminates all kinds of hard to debug problems and enables the runtime to manage complex and error prone processes for developers. Functional programming is designed to achieve the same optimization for the algorithms you write, so that you can work from a higher level of abstraction while […]

  • Kafka in MICRONAUT microservices

    Time:2019-12-6

    Today, we will passApache KafkaTopic builds micro services that communicate asynchronously with each other. We useMicronautFramework forKafkaIntegration provides specialized libraries. Let’s briefly introduce the architecture of the sample system. We have four microservices:Order service,Itinerary service,Driver serviceandPassenger service。 The implementation of these applications is very simple. They all have memory storage and are connected to the […]

  • In depth explanation of spring boot efficient data aggregation

    Time:2019-12-6

    background Interface development is the most common scenario in back-end development, which may be restful interface or RPC interface. Interface development is often to extract data from everywhere and then assemble the results, especially those partial business interfaces For example, I need to implement an interface to pull the integration data of user basic information […]

  • Learn similar function structures in different java.net languages

    Time:2019-12-5

    Preface Functional programming languages contain a number of common functions. But sometimes it’s hard for developers to switch between languages because familiar functions have unfamiliar names. Functional languages tend to name these common functions based on function instances. Languages derived from script backgrounds tend to use more descriptive names (sometimes multiple names, including multiple aliases […]

  • Create spring boot microservice project

    Time:2019-12-5

    Create a microservice project HelloWorld for testing Create project Write service code @RestController public class HelloWorld { @RequestMapping(“/hello”) public String Hello(@RequestParam String name){ Return “Hello! “+ name +”, this is a microservice. “; } } Edit the configuration file application.properties: spring.application.name=spring-cloud-provider-01 server.port=9000 test run Source code GitHub warehouse: https://github.com/sunweisheng/spring-cloud-example

  • Consul cluster server mode

    Time:2019-12-4

    Consul cluster server mode Architecture diagram There are two operation modes of consul in production environment: server mode and client mode (DEV mode belongs to development mode, which is not discussed here). First, we use server mode to build a consul cluster, as shown in the figure below: Consul server a, B and C are […]

  • Installation and usage of selenium + chromedriver

    Time:2019-12-4

    Selenium is a tool for testing web applications. Selenium tests run directly in the browser, just as real users do. For the crawler, using selenium to control the browser to crawl the data on the Internet must be the killer weapon of the crawler. Here, I will introduce the general use of selenium + Google […]