Tag:Interceptor

  • Dotnet core 3. X uses Autofac to enhance dependency injection

    Time:2021-1-23

    In the last “dotnet core 3. X dependency injection”, we briefly introduced the dependency injection function of the dotnet core framework itself. In most cases, we can use the dependency injection function of the framework. In some special scenarios, we need to introduce a third-party injection framework. Why use Autofac? If you used dependency injection […]

  • Design patterns used to improve extensibility in framework source code

    Time:2021-1-21

    Why improve code scalability We write code to serve certain requirements, but these requirements are not immutable. When the requirements change, if our code has good scalability, we may only need to simply add or delete modules. If the scalability is not good, all the code may need to be rewritten, which is a disaster, […]

  • Quick attack on spring cloud gateway

    Time:2021-1-21

    Meet spring cloud gateway Spring cloud gateway is an API gateway based on spring 5, project reactor and spring boot 2. It is one of the main components of spring cloud micro service ecosystem. Spring cloud gateway is mainly responsible for the routing and distribution of interface requests, and supports extended operations such as request […]

  • Mybatis reverse engineering use posture is not right, the table is empty, heart flustered a than, so write a plug-in.

    Time:2021-1-15

    When using mybatis reverse engineering, the posture of delete method is not right, resulting in the table being emptied. After the last refresh in production, it is found that there is no data in the table, and a cool feeling rushes straight to the sky from the center of the foot board. So I developed […]

  • flume

    Time:2021-1-7

    1、 What Data acquisition is an indispensable step of a complete big data system Log file: flume / logstash Business data: sqoop Crawler: external data crawler Basic introduction Flume is a distributed, highly reliable mass data acquisition system (1t / day) operating mechanismEach flume instance has an agent, which is equivalent to a messengerThe agent […]

  • Kafka series — 3.1, basic use of producer client

    Time:2020-12-25

    Necessary parameters bootstrap.servers The parameter isbrokerYou don’t need to fill in all the addresses becausekafkaFrom the currentbrokerGet more information frombrokerInformation. But for someonebrokerIf you hang up, you should fill in more than onebrokeraddress key.serializer newskeyHow to serialize value.serializer How to serialize message content Sample code Properties properties = new Properties(); properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, “127.0.0.1:9092”); properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, […]

  • Making wheels by hand: implementing a simple AOP framework

    Time:2020-12-22

    Making wheels by hand: implementing a simple AOP framework Intro Recently implemented an AOP framework — fluent aspects. The API is basically stable. Write an article to share the design of this AOP framework. Overall design overview IProxyTypeFactory It is used to generate Proxy types. By default, it provides an implementation based on emit dynamic […]

  • Springboot Episode 5: integrating listeners / filters and interceptors

    Time:2020-12-14

    Springboot Episode 5: integrating listeners / filters and interceptors In the actual development process, we often meet some business requirements, such as system startup initialization information, statistics of online number, number of online users, filtering sensitive / high vocabulary, access control (URL level) and other business requirements. To achieve the above functions, will be more […]

  • Kafka series — 4.1, basic introduction to consumers

    Time:2020-12-5

    1. Consumer consumption of demo Properties prop = new Properties(); prop.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); prop.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); prop.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, “kafka:9092”); prop.put(ConsumerConfig.GROUP_ID_CONFIG, “testConsumer”); prop.put(ConsumerConfig.CLIENT_ID_CONFIG, “consumerDemo”); KafkaConsumer<String, String> consumer = new KafkaConsumer<>(prop); consumer.subscribe(Collections.singleton(“test”)); while (true) { ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(1000)); for (ConsumerRecord<String, String> record : records) { String key = record.key(); String value = record.value(); System.err.println(record.toString()); } } 2. Basic […]

  • (2) start with mybatis

    Time:2020-12-3

    Prospect review In the MVP version, we have implemented a basic running mybatis. As the saying goes, everything is difficult at the beginning, then difficult in the middle. The plug-in mechanism of mybatis is the second soul besides dynamic proxy. Let’s experience the pain and happiness of this interesting soul~ The role of plug-ins In […]

  • Writing mybatis from scratch (2) detailed explanation of mybatis interceptor plug-in mechanism

    Time:2020-12-2

    Prospect review In the MVP version, we have implemented a basic running mybatis. As the saying goes, everything is difficult at the beginning, then difficult in the middle. The plug-in mechanism of mybatis is the second soul besides dynamic proxy. Let’s experience the pain and happiness of this interesting soul~ The role of plug-ins In […]

  • Interceptor intercept exploration in angular2

    Time:2020-12-1

    original intention I saw angular2 officially released before. I looked at it in the past and felt good, so I went into the pit.In the process of using it, I want to write an interceptor like angular1 Interceptor in angular1 .factory(‘HttpRequestInterceptor’, [‘$q’, ‘$injector’, ‘ConfigService’, ‘DialogService’, function($q, $injector, ConfigService, DialogService) { return { request: function(config) { […]