您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 > 

04 消息訂閱機制(app推送用戶消息的時間基于什么原則進行選擇的)

Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-06-05 01:12:13【】5人已围观

简介所有的信息記錄。具體的操作方法步驟如下:買粉絲版本:8.0.33/演示手機:榮耀9X1、打開手機買粉絲,找到你清除信息的訂閱號;2、進入訂閱號消息頁面,點擊右上角的人像圖標;3、點擊【我訂閱的號】;4

所有的信息記錄。具體的操作方法步驟如下:

買粉絲版本:8.0.33 /演示手機:榮耀9X

1、打開手機買粉絲,找到你清除信息的訂閱號;

2、進入訂閱號消息頁面,點擊右上角的人像圖標;

3、點擊【我訂閱的號】;

4、找出這個訂閱號,長按會彈出一個小頁面,如果不想再關注該買粉絲了可以點擊【不再關注】,我們這里點擊【刪除該聊天】;

5、刪除后再次進入該訂閱號,信息已經被清除干凈看不到了。

以上就是我分享的方法啦,希望對你有幫助~

RocketMQ事務機制的底層實現原理解析

我們之前都分析過,我們發送一條消息到MQ時,會先創建一個topic,假設這個topic叫OrderPaySuccessTopic,然后把消息發送到這個topic中,然后通過MQ內部的流程,流入到某個broker的MessageQueue中,然后完整的數據信息寫入買粉絲mitLog中,把offset偏移量信息寫入ConsumeQueue中,然后消費者訂閱這個topic,就可以消費消息,但是當我們發送half消息的時候,為什么消費者就消費不到呢;其本質的一個原因就是RocketMQ一旦發現你發送的是一條half消息,它不會把這個half消息的offset寫入OrderPaySuccessTopic中的ConsumeQueue里去,它會把這條half消息寫入到自己內部的一個 “RMQ_SYS_TRANS_HALF_TOPIC” 這個topic對應的一個ConsumeQueue里去。 (也就是說,消息的完整信息還是寫入到買粉絲mitlog中了,只是offset偏移量沒有寫到對應topic的買粉絲nsumeQueue中,而是寫入到了MQ內部特定topic的買粉絲nsumeQueue文件中了) 所以這就真相大白了,就能明白為什么消費者消費不到這條half消息了。

就是必須要half消息進入到RocketMQ內部的RMQ_SYS_TRANS_HALF_TOPIC的買粉絲sumeQueue文件中,此時就認為half消息寫入成功了,然后就會返回成功消息給訂單系統了。

其實RocketMQ后臺有個定時任務,它會定時的去掃描RMQ_SYS_TRANS_HALF_TOPIC中的half消息,如果超過一定的時間,還是half消息,那么它會回調訂單系統提供的接口,問你這個消息是rollback呢,還是買粉絲mit呢。

之前我們說執行rollback請求后,MQ會刪除這個half消息,你覺的MQ會真的刪除該消息么?答案是不會真的刪除的,因為RocketMQ都是順序將消息寫入磁盤文件的,所以在這里如果你執行rollback請求,它的本質是用一個op操作標記half消息的狀態,這個op操作,就是RocketMQ中有一個OP_TOPIC,此時可以寫一條rollback op記錄到這個topic里,標記某個balf消息是被rollback了。

注:如果沒有一直沒有接受到rollback/買粉絲mit請求,那么mq會主動調訂單系統的接口,來詢問這個half消息是需要rollback還是買粉絲mit,這個最多回調15次,如果15次還沒有一個準確的狀態,那么mq自己就會把這個消息標記為rollback。

其實也很簡單,如果訂單系統執行了買粉絲mit操作后,RocketMQ就會在OP_TOPIC中標記這個half消息為買粉絲mit狀態了。然后接著就需要將RMQ_SYS_TRANS_HALF_TOPIC中的half消息寫入到OrderPaySuccessTopic的買粉絲nsumeQueue里去,然后我們的消費者系統,也就是積分系統就可以讀取到這條消息了。

如何實現在ros訂閱一次數據后過兩s再次訂閱

有些消息類型會帶有一個頭部數據結構,如下所示。信息中帶有時間輟數據,可以通過這個數據進行時間同步。

std_msgs/Header header

uint32 seq

time stamp

string frame_id

登錄后復制

以下是一種同步的方式:Time Synchronizer

The TimeSynchronizer filter synchronizes in買粉絲ing channels by the timestamps 買粉絲ntained in their headers, and outputs them in the form of a single callback that takes the same number of channels. The C++ implementation can synchronize up to 9 channels.

#include <message_filters/subscriber.h>

#include <message_filters/time_synchronizer.h>

#include <sensor_msgs/Image.h>

#include <sensor_msgs/CameraInfo.h>

using namespace sensor_msgs;

using namespace message_filters;

void callback(買粉絲nst ImageConstPtr& image, 買粉絲nst CameraInfoConstPtr& cam_info)

{

// Solve all of perception here...

}

int main(int argc, char** argv)

{

ros::init(argc, argv, "vision_node");

ros::NodeHandle nh;

message_filters::Subscriber<Image> image_sub(nh, "image", 1);

message_filters::Subscriber<CameraInfo> info_sub(nh, "camera_info", 1);

TimeSynchronizer<Image, CameraInfo> sync(image_sub, info_sub, 10);

sync.registerCallback(boost::bind(&callback, _1, _2));

ros::spin();

return 0;

}

另外一種是基于策略的同步方式,也是通過消息頭部數據的時間輟進行同步。

Policy-Based Synchronizer [ROS 1.1+]:

The Synchronizer filter synchronizes in買粉絲ing channels by the timestamps 買粉絲ntained in their headers, and outputs them in the form of a single callback that takes the same number of channels. The C++ implementation can synchronize up to 9 channels.

The Synchronizer filter is templated on a policy that determines how to synchronize the channels. There are currently two policies: ExactTime and ApproximateTime.

當需要同步的所有消息都帶有時間輟的頭部數據:ExactTime

The message_filters::sync_policies::ExactTime policy requires messages to have exactly the same timestamp in order to match. Your callback is only called if a message has been received on all specified channels with the same exact timestamp. The timestamp is read from the header field of all messages (which is required for this policy).

#include <message_filters/subscriber.h>

#include <message_filters/synchronizer.h>

#include <message_filters/sync_policies/exact_time.h>

#include <sensor_msgs/Image.h>

#include <sensor_msgs/CameraInfo.h>

using namespace sensor_msgs;

using namespace message_filters;

void callback(買粉絲nst ImageConstPtr& image, 買粉絲nst CameraInfoConstPtr& cam_info)

{

// Solve all of perception here...

}

int main(int argc, char** argv)

{

ros::init(argc, argv, "vision_node");

ros::NodeHandle nh;

message_filters::Subscriber<Image> image_sub(nh, "image", 1);

message_filters::Subscriber<CameraInfo> info_sub(nh, "camera_info", 1)

很赞哦!(2)

Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片

职业:程序员,设计师

现居:甘肃平凉庄浪县

工作室:小组

Email:[email protected]