{
"guid": "client-guid",
"notify_type": 1010,
"data": {}
}| 字段 | 类型 | 说明 |
|---|---|---|
guid | string | 实例 ID。 |
notify_type | integer | 通知类型。 |
data | object | 通知数据,不同类型结构不同。 |
notify_http_enable = True
notify_logger_enable = Truenotify_mqtt_enable = True
notify_mqtt_host = 127.0.0.1
notify_mqtt_port = 1883
notify_mqtt_username =
notify_mqtt_passwd =
notify_mqtt_protocol = 4
notify_mqtt_topic = /com/xunyuan/chatserver/notify2notify_redis_enable = True
notify_redis_host = 127.0.0.1
notify_redis_port = 6379
notify_redis_passwd =
notify_redis_channel = wechat:notifyredis-cli SUBSCRIBE wechat:notifynotify_kafka_enable = True
notify_kafka_bootstrap_servers = kafka-1:9092,kafka-2:9092
notify_kafka_topic = wechatMessage
notify_kafka_compression_type = gzip
notify_kafka_acks = allguid,消息 value 为统一通知 JSON。notify_type 查看触发场景、字段说明和 JSON 示例。msg_type 查看新消息通知示例。notify_type=1012。notify_type=1086 后按 收藏同步 拉取变更。{
"guid": "client-guid",
"notify_type": 1086,
"data": {
"sync_scope": 5
}
}data.sync_scope 原样作为 /fav/fav_sync 的 sync_scope,并带上该实例已保存的收藏游标。通知只提示有变化,服务不自动拉取;逐批保存和续批方法见 收藏同步。{
"guid": "client-guid",
"notify_type": 1003,
"data": {
"errcode": 0,
"errmsg": "success"
}
}{
"guid": "client-guid",
"notify_type": 1010,
"data": {
"from_username": "wxid_xxxxx",
"to_username": "wxid_yyyyy",
"msg_type": 1,
"content": "你好",
"msg_id": "7350012345678901234"
}
}{
"guid": "client-guid",
"notify_type": 1200,
"data": {
"userName": {
"string": "wxid_xxxxx"
},
"nickName": {
"string": "好友昵称"
},
"bitVal": 1,
"verifyFlag": 0
}
}{
"guid": "client-guid",
"notify_type": 1210,
"data": {
"chatroomUserName": "123456789@chatroom",
"serverVersion": 20
}
}{
"guid": "client-guid",
"notify_type": 1012,
"data": {
"msg_session_id": "session_xxxxx@findermsg",
"seq": "18",
"is_sender": false,
"item_type": 1,
"sub_type": 0,
"sync_key_type": 9,
"ext_info": "",
"message": {
"from_username": "finder_sender@findermsgstranger",
"to_username": "finder_receiver@finder",
"create_time": 1785413990,
"desc": "你好",
"msg_id": "7350012345678901234",
"legacy_msg_id": 0,
"msg_seq": 0,
"msg_type": 1,
"status": 0,
"img_status": 0,
"img_buf": "",
"source": "",
"content": "你好"
}
}
}1012 的消息字段位于 data.message,不要按普通 1010 的扁平字段读取;详见 1012 Finder 私信新消息。