Tag:springboot

  • Springboot uses the protobuf format interface

    Time:2021-10-23

    Springboot uses the protobuf format interface Create a springboot project. Pom.xml is as follows: <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.2.RELEASE</version> <relativePath/> <!– lookup parent from repository –> </parent> <groupId>com.example.protobuf</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>demo</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> […]

  • Analysis of SQL monitoring by integrating Druid connection pool with springboot

    Time:2021-10-14

    Druid connection pool is an open source database connection pool project of Alibaba. Druid connection pool is born for monitoring. It has built-in powerful monitoring function. The monitoring feature does not affect the performance. Druid’s monitoring and statistics function is realized through the filter chain extension. The collected information is very comprehensive, including SQL execution, […]

  • Integrating the Apollo configuration center with springboot

    Time:2021-9-28

    Introduction to Apollo Apollo (Apollo) is a distributed configuration center developed by Ctrip framework department. It can centrally manage the configuration of different application environments and clusters. After the configuration is modified, it can be pushed to the application end in real time. It also has standardized permissions, process governance and other characteristics. It is […]

  • An example of jmstemplate based on ActiveMQ in springboot

    Time:2021-9-27

    Steps for using ActiveMQ in springboot: 1. Introducing jar packages into POM: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-pool</artifactId> <!– <version>5.7.0</version> –> </dependency> 2. Configure ActiveMQ in the spring boot configuration file spring.activemq.broker-url=tcp://localhost:61616 spring.activemq.user=admin spring.activemq.password=admin spring.activemq.in-memory=true spring.activemq.pool.enabled=false 3. Add the corresponding bean generation rule in the application package com.telligen.ascertain; import org.apache.activemq.ActiveMQConnectionFactory; […]

  • How to implement offset consumption specified by Kafa in spring boot

    Time:2021-8-28

    This article mainly introduces how to realize Kafa specified offset consumption in springboot. It is introduced in great detail through the example code, which has a certain reference value for everyone’s study or work. Friends in need can refer to it In the process of Kafka consumption, it is inevitable to encounter the scenario of […]

  • Shiro integration spring boot front and rear end separation

    Time:2021-8-19

    This example shares the specific code of Shiro integrating the front and back end separation of spring boot for your reference. The specific contents are as follows 1. Shiro integrates spring boot configuration package com.hisi.config; import java.util.LinkedHashMap; import java.util.Map; import javax.servlet.Filter; import org.apache.shiro.session.mgt.eis.MemorySessionDAO; import org.apache.shiro.session.mgt.eis.SessionDAO; import org.apache.shiro.spring.LifecycleBeanPostProcessor; import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; […]

  • Springboot + Shiro front and back end separation permissions

    Time:2021-8-17

    The information after Shiro passes the verification is saved in the session, and Ajax transmits different sessionids every time, so the main difference is to modify the way Shiro obtains the sessionid. After logging in, the background sessionid is sent to the front end and stored in a cookie (this storage place depends on the […]

  • How does springboot handle the method of verifying parameters gracefully

    Time:2021-8-12

    preface One of the most annoying things about web development is to verify the parameters. Basically, each interface needs to verify the parameters. For example, some format verification and non empty verification are essential. It is easy to handle if there are few parameters, but if there are many parameters, a large number of if […]

  • Springboot integration httpclient code example

    Time:2021-7-31

    This article mainly introduces the spring boot integration httpclient code example. The example code is introduced in great detail, which has a certain reference value for everyone’s study or work. Friends in need can refer to it Create httpclientconfig configuration class @Configuration @PropertySource(value=”classpath:/properties/httpClient.properties”) public class HttpClientConfig { @Value(“${http.maxTotal}”) private Integer maxTotal; // maximum connection @Value(“${http.defaultMaxPerRoute}”) […]

  • Springboot feignclient annotation and parameters

    Time:2021-7-26

    1、 Feignclient annotation Feignclient annotation is modified by @ target (ElementType. Type), indicating that the function target of feignclient annotation is on the interface @FeignClient(name = “github-client”, url = “https://api.github.com”, configuration = GitHubExampleConfig.class) public interface GitHubClient { @RequestMapping(value = “/search/repositories”, method = RequestMethod.GET) String searchRepo(@RequestParam(“q”) String queryStr); } After the interface is declared, it can […]

  • Implementation of request background data display pie chart with springboot + ecarts

    Time:2021-7-5

    scene Springboot builds the background to obtain data, and the front-end visualizes the pie chart of ecarts. Ecarts3 website Get ecarts Select the version you need to download from the download interface of the official website. According to the developer’s functional and volume requirements, we provide different packaged downloads. If you have no volume requirements, […]

  • Springboot dynamically loads the histogram of ecarts

    Time:2021-6-30

    In this paper, we share the specific code of springboot dynamic loading ecarts histogram for your reference. The specific content is as follows The first time to write a blog, no more nonsense, directly on the code Background code @RequestMapping(“/rcbchart”) @ResponseBody private String dwcb(@RequestParam(“scrq1”) String scrq1,@RequestParam(“scrq2”) String scrq2, @RequestParam(“dwmc”) String dwmc) throws ParseException { List […]