Recommended articles about message duplication

黄舟
Release: 2017-06-11 09:28:19
Original
2808 people have browsed it

As mentioned in the previous blog post, WeChat messages can be roughly divided into two types. One is ordinary messages including text, voice, pictures, etc., and the other is the event type to be described in this article. . Including: following/unfollowing events, scanning QR code events with parameters, reporting geographical location events, custom menu-related events, etc. This article explains them one by one. As mentioned in the previous article, if the WeChat server does not receive a response within 5 seconds, it will disconnect the connection and reinitiate the request, retrying three times in total. In this case, the problem arises. There is such a scenario: when a user follows a WeChat account, the current user information is obtained, and then the information is written to the database. Similar to registration on PC website. Perhaps because of this concern, the business logic we need to handle is relatively complex. Such as sending points, writing user logs, and assigning user groups. Wait... A series of logic needs to be executed, or the network environment is relatively complex and there is no guarantee that the current user's operation will be responded to within 5 seconds. Then if the operation is not completed yet, the WeChat server pushes the same attention event to our server. We will execute our logic again, which may lead to duplicate data in the database (some children's shoes will say, I am inserting data

1. WeChat Development Receiving event push and message deduplication

Recommended articles about message duplication

##Introduction: As mentioned in the previous blog post, WeChat Messages can be roughly divided into two types, one is ordinary messages including text, voice, pictures, etc., and the other is the event type to be included in this article: follow/unfollow events, scanning with parameter two. QR code events, reporting of geographical location events, custom menu-related events, etc. This article will explain them one by one.

#2.

Discuss simple issues in WeChat development#.

Recommended articles about message duplication##Introduction: WeChat public platform developer document description: [color=#33CCCC] When an ordinary WeChat user sends a message to a public account When sending a message, the WeChat server will POST the XML data packet of the message to the URL filled in by the developer. The push XML data packet structure of each message type is as follows. If the WeChat server does not receive a response within five seconds, it will disconnect and reinitiate the request. , a total of three retries. Regarding the retry message deduplication, it is recommended to use msgid deduplication.

3.

Use C# to develop WeChat public account receiving event push and message deduplication. Method introduction

Recommended articles about message duplicationIntroduction: This article mainly introduces the development of C# WeChat public account to receive event push and message deduplication methods, a detailed analysis of the usage techniques of event push and message deduplication, which has certain reference value for WeChat development. Friends in need can refer to

##4. C#WeChat public account development method of receiving event push and message deduplication

Recommended articles about message duplicationIntroduction: This This article mainly introduces the method of receiving event push and message deduplication in the development of C# WeChat public account, and analyzes the usage skills of event push and message deduplication in detail. It has certain reference value for WeChat development. Friends who need it can refer to it

[Related Q&A recommendations]:

##node.js - Why are the MsgIds of WeChat messages duplicated and unable to be duplicated ##.

#python - Tornado implementation of message deduplication in WeChat subscription accounts and how to determine in Tornado that the WeChat server has terminated the first request connection

The above is the detailed content of Recommended articles about message duplication. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!