Tag:send data

  • The first Kafka practice


    I have been working for three years, but also because of my laziness and my own level. I haven’t summed up too much after practicing some unused technologies. This time, it is also because some problems encountered in the work need to be used in Kafka, and some problems have been encountered and solved in […]

  • PHP mysqli_ stmt_ bind_ Param mysqli function


    Definition and Usage mysqli_stmt_bind_param– bind variables to prepared statements as parameters Version support PHP4 PHP5 PHP7 I won’t support it support support grammar mysqli_stmt_bind_param ( mysqli_stmt $stmt , string $types , mixed &$var1 [, mixed &$… ] ) Pass to mysqli_ In the SQL statement of prepare(), bind variables for parameter markers. be careful: if […]

  • Kotlin protocol communication mechanism: Channel


    Coroutines Channels Multithreading communication in Java always involves the read and write of shared mutable state, and there are synchronization, deadlock and other issues to deal with The channel in coprocess is used for communication between coprocesses. Its purpose is to: Do not communicate by sharing memory; instead, share memory by communicating. Channel basics Channels […]

  • Kafka sending message and flenk reading Kafka message code example


    1. Send data tool class code to Kafka corresponding topic import java.util.{HashMap, Map, Properties} import org.apache.kafka.clients.producer.{KafkaProducer, ProducerRecord} import scala.io.Source /** * @Author: ch * @Date: 07/05/2020 12:20 AM * @Version 1.0 *@ describe: send data to Kafka’s corresponding topic */ object KafkaUtils { val broker_list = “localhost:9092” Val topic = “test” // Kafka topic, which […]

  • Basic Vue connects websocket and does heartbeat detection


    These parameters are required in data data() { return { Websock: null, // connection established Lockconnect: false, // is the connection really established Timeout: 28 * 1000, // 30 seconds Timeoutobj: null, // outer heartbeat countdown Servertimeoutobj: null, // inner heartbeat detection Timeoutnum: null // countdown of disconnection and reconnection }; }, In methods: initWebSocket() […]

  • Real time communication solution of Vue micro front end


    introduce We know that there are many ways of parent-child communication in the micro front-end, such aslocation、Cookie、LocalStorage、windowBut they all have a common problem that they can’tReal time monitoring of changesFor example, skin changing or multi language switching, if you want to apply it to a sub project, you must refresh the page, and then you […]

  • Analysis of Kafka network layer


    We know that Kafka is based on TCP connection. It doesn’t use netty as a TCP server like many middleware. But I wrote a set based on Java NiO. The reason why Kafka didn’t choose netty can be seen here. Students who don’t know much about Java NiO can read these two articles first. This […]

  • Master-slave copy of redis source code analysis (2)


    Repl backlog is a fixed length ring buffer maintained by the master. The default size is1MIn the configuration filerepl-backlog-sizeItem to configure. It can be regarded as a FIFO queue. When there are too many elements in the queue, the first element to enter the queue is ejected (the data is overwritten). It exists to solve […]

  • 15. Android realizes TCP client, supports reading and writing


    In the last chapter14. Android – using SendMessage threads to communicate with each otherWe learned how to send data between threads Next, we will learn how to read and write TCP through socket It should be noted that the socket must be written in the sub thread and cannot be used directly in the main […]

  • The life cycle of Vue


    Life cycle introduction In short, the various states that a component experiences from the beginning to the end are the life cycle of a component Life cycle diagram of Vue Before create Before create Details: after the instance is initialized, when the component is created, El, data and message are all under found Scenario: the […]

  • Java cross domain, resttemplate high and send exception and configuration, JSON data long to string


    Cross domain support import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.cors.CorsConfiguration;import org.springframework.web.cors.UrlBasedCorsConfigurationSource;import org.springframework.web.filter.CorsFilter; @Configurationpublic class CorsConfig { /** *Cross domain support * * @return */ @Bean public CorsFilter corsFilter() { final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); final CorsConfiguration config = new CorsConfiguration(); Config.setallowcredentials (true); // allow cookies to cross domains Config.addallowedorigin (“*”); // ා URI that allows requests to […]

  • Data communication of multiple domain name tabs implemented by PostMessage in API based on H5


    Preface I have found many cases of multi tab data communication on the InternetThe general principle is to use PostMessage to realize cross domain problem communicationThe current method can simply communicate data of multiple tabs in time after multiple local testsUpper Code:A pagePart JS function receiveMessage(event) { console.log(event.data); if (event.origin !== “http://localhost:63343”){ return; } } […]