{"id":87765,"date":"2026-07-30T21:08:58","date_gmt":"2026-07-30T13:08:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/87765.html"},"modified":"2026-07-30T21:08:58","modified_gmt":"2026-07-30T13:08:58","slug":"12306%e9%a1%b9%e7%9b%ae%e5%ad%a6%e4%b9%a0day6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/87765.html","title":{"rendered":"12306\u9879\u76ee\u5b66\u4e60day6"},"content":{"rendered":"<h2>\u5b66\u5b8c 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u540e&#xff0c;\u6211\u5bf9\u9ad8\u5e76\u53d1\u7cfb\u7edf\u8bbe\u8ba1\u7684\u6574\u4f53\u7406\u89e3<\/h2>\n<p>\u524d\u6bb5\u65f6\u95f4\u6211\u7cfb\u7edf\u5b66\u4e60\u4e86\u4e00\u4e2a 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u3002\u521a\u5f00\u59cb\u770b\u8fd9\u4e2a\u9879\u76ee\u65f6&#xff0c;\u6211\u66f4\u591a\u5173\u6ce8\u7684\u662f\u201c\u7528\u4e86\u54ea\u4e9b\u6280\u672f\u201d&#xff1a;Redis\u3001RocketMQ\u3001ShardingSphere\u3001Canal\u3001Redisson\u3001Sentinel\u3001Spring Boot Starter \u7b49\u3002<\/p>\n<p>\u4f46\u771f\u6b63\u628a\u6e90\u7801\u3001\u4e1a\u52a1\u94fe\u8def\u548c\u9762\u8bd5\u95ee\u9898\u4e32\u8d77\u6765\u4e4b\u540e&#xff0c;\u6211\u53d1\u73b0\u8fd9\u4e2a\u9879\u76ee\u6700\u503c\u5f97\u5b66\u4e60\u7684\u5730\u65b9\u5e76\u4e0d\u662f\u67d0\u4e00\u4e2a\u5355\u72ec\u6280\u672f\u70b9&#xff0c;\u800c\u662f\u5b83\u56f4\u7ed5\u201c\u9ad8\u5e76\u53d1\u8d2d\u7968\u201d\u8fd9\u4e2a\u6838\u5fc3\u573a\u666f&#xff0c;\u628a\u7f13\u5b58\u3001\u6d88\u606f\u961f\u5217\u3001\u5206\u5e93\u5206\u8868\u3001\u5e42\u7b49\u3001\u5206\u5e03\u5f0f\u9501\u3001\u5f02\u5e38\u5904\u7406\u3001\u654f\u611f\u6570\u636e\u4fdd\u62a4\u7b49\u80fd\u529b\u7ec4\u5408\u5230\u4e86\u4e00\u8d77\u3002<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u662f\u6211\u5b66\u5b8c\u6574\u4e2a\u9879\u76ee\u540e\u7684\u603b\u7ed3&#xff0c;\u4e0d\u518d\u5355\u72ec\u5c55\u5f00\u67d0\u4e00\u4e2a\u77e5\u8bc6\u70b9&#xff0c;\u800c\u662f\u4ece\u6574\u4f53\u89d2\u5ea6\u590d\u76d8&#xff1a;\u8fd9\u4e2a\u9879\u76ee\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898\u3001\u6838\u5fc3\u94fe\u8def\u600e\u4e48\u8bbe\u8ba1\u3001\u6bcf\u4e2a\u6280\u672f\u70b9\u5728\u91cc\u9762\u627f\u62c5\u4ec0\u4e48\u89d2\u8272&#xff0c;\u4ee5\u53ca\u6211\u5b66\u5b8c\u4e4b\u540e\u5bf9\u9ad8\u5e76\u53d1\u7cfb\u7edf\u8bbe\u8ba1\u6709\u54ea\u4e9b\u65b0\u7684\u7406\u89e3\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u6211\u5bf9\u8fd9\u4e2a\u9879\u76ee\u6574\u4f53\u5b9a\u4f4d\u7684\u7406\u89e3<\/h3>\n<p>\u8fd9\u4e2a\u9879\u76ee\u6a21\u62df\u7684\u662f 12306 \u8d2d\u7968\u7cfb\u7edf&#xff0c;\u6838\u5fc3\u4e1a\u52a1\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u7528\u6237\u6ce8\u518c\u3001\u767b\u5f55\u3001\u4e58\u8f66\u4eba\u7ba1\u7406<\/li>\n<li>\u8f66\u6b21\u67e5\u8be2\u3001\u4f59\u7968\u67e5\u8be2<\/li>\n<li>\u7528\u6237\u8d2d\u7968\u3001\u9009\u5ea7\u3001\u751f\u6210\u8ba2\u5355<\/li>\n<li>\u652f\u4ed8\u56de\u8c03\u3001\u8ba2\u5355\u72b6\u6001\u53d8\u66f4<\/li>\n<li>\u8d85\u65f6\u672a\u652f\u4ed8\u81ea\u52a8\u5173\u5355<\/li>\n<li>\u8ba2\u5355\u67e5\u8be2\u3001\u51b7\u70ed\u6570\u636e\u533a\u5206<\/li>\n<li>\u4f59\u7968\u7f13\u5b58\u540c\u6b65\u3001\u5e93\u5b58\u56de\u6eda<\/li>\n<\/ul>\n<p>\u4ece\u670d\u52a1\u5212\u5206\u6765\u770b&#xff0c;\u9879\u76ee\u4e0d\u662f\u4e00\u4e2a\u5355\u4f53\u5e94\u7528&#xff0c;\u800c\u662f\u62c6\u6210\u4e86\u591a\u4e2a\u5fae\u670d\u52a1&#xff1a;<\/p>\n<p>user-service        \u7528\u6237\u670d\u52a1<br \/>\n ticket-service      \u8f66\u7968\u670d\u52a1<br \/>\n order-service       \u8ba2\u5355\u670d\u52a1<br \/>\n pay-service         \u652f\u4ed8\u670d\u52a1<br \/>\n aggregation-service \u805a\u5408\u670d\u52a1<br \/>\n gateway-service     \u7f51\u5173\u670d\u52a1<\/p>\n<p>\u6211\u7684\u7406\u89e3\u662f&#xff0c;\u8fd9\u79cd\u62c6\u5206\u4e0d\u662f\u4e3a\u4e86\u201c\u5fae\u670d\u52a1\u800c\u5fae\u670d\u52a1\u201d&#xff0c;\u800c\u662f\u56f4\u7ed5\u4e1a\u52a1\u8fb9\u754c\u62c6\u7684&#xff1a;<\/p>\n<ul>\n<li>\u7528\u6237\u670d\u52a1\u8d1f\u8d23\u7528\u6237\u8eab\u4efd\u548c\u4e58\u8f66\u4eba\u4fe1\u606f\u3002<\/li>\n<li>\u8f66\u7968\u670d\u52a1\u8d1f\u8d23\u8f66\u6b21\u3001\u5ea7\u4f4d\u3001\u4f59\u7968\u548c\u8d2d\u7968\u6838\u5fc3\u903b\u8f91\u3002<\/li>\n<li>\u8ba2\u5355\u670d\u52a1\u8d1f\u8d23\u8ba2\u5355\u751f\u547d\u5468\u671f\u3002<\/li>\n<li>\u652f\u4ed8\u670d\u52a1\u8d1f\u8d23\u652f\u4ed8\u5355\u3001\u652f\u4ed8\u56de\u8c03\u3001\u9000\u6b3e\u3002<\/li>\n<li>\u805a\u5408\u670d\u52a1\u8d1f\u8d23\u628a\u591a\u4e2a\u670d\u52a1\u7684\u6570\u636e\u7ec4\u88c5\u7ed9\u524d\u7aef\u3002<\/li>\n<li>\u7f51\u5173\u670d\u52a1\u8d1f\u8d23\u7edf\u4e00\u5165\u53e3\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u8ba9\u6211\u7406\u89e3\u5230&#xff0c;\u5fae\u670d\u52a1\u62c6\u5206\u7684\u5173\u952e\u4e0d\u662f\u670d\u52a1\u6570\u91cf&#xff0c;\u800c\u662f\u8fb9\u754c\u662f\u5426\u6e05\u6670\u3002\u6bd4\u5982\u8d2d\u7968\u4e0b\u5355\u4e00\u5b9a\u4f1a\u6d89\u53ca\u8f66\u7968\u548c\u8ba2\u5355&#xff0c;\u4f46\u8f66\u7968\u670d\u52a1\u4e0d\u5e94\u8be5\u76f4\u63a5\u7ba1\u7406\u8ba2\u5355\u8868&#xff0c;\u8ba2\u5355\u670d\u52a1\u4e5f\u4e0d\u5e94\u8be5\u76f4\u63a5\u64cd\u4f5c\u5ea7\u4f4d\u5e93\u5b58&#xff0c;\u6240\u4ee5\u4e24\u8005\u4e4b\u95f4\u901a\u8fc7\u8fdc\u7a0b\u8c03\u7528\u548c\u6d88\u606f\u673a\u5236\u534f\u4f5c\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u6574\u4e2a\u8d2d\u7968\u94fe\u8def\u662f\u6211\u8ba4\u4e3a\u6700\u6838\u5fc3\u7684\u4e3b\u7ebf<\/h3>\n<p>\u5b66\u4e60\u8fd9\u4e2a\u9879\u76ee\u65f6&#xff0c;\u6211\u89c9\u5f97\u6700\u5e94\u8be5\u5148\u6293\u4f4f\u7684\u662f\u8d2d\u7968\u4e3b\u94fe\u8def\u3002<\/p>\n<p>\u5927\u81f4\u6d41\u7a0b\u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>\u7528\u6237\u67e5\u8be2\u8f66\u6b21<br \/>\n    \u2193<br \/>\n\u9009\u62e9\u8f66\u6b21\u548c\u4e58\u8f66\u4eba<br \/>\n    \u2193<br \/>\n\u63d0\u4ea4\u8d2d\u7968\u8bf7\u6c42<br \/>\n    \u2193<br \/>\n\u4ee4\u724c\u6876\u6821\u9a8c\u4f59\u7968<br \/>\n    \u2193<br \/>\n\u5ea7\u4f4d\u9009\u62e9\u4e0e\u9501\u5b9a<br \/>\n    \u2193<br \/>\n\u521b\u5efa\u8ba2\u5355<br \/>\n    \u2193<br \/>\n\u53d1\u9001\u5ef6\u8fdf\u5173\u5355\u6d88\u606f<br \/>\n    \u2193<br \/>\n\u7528\u6237\u652f\u4ed8<br \/>\n    \u2193<br \/>\n\u652f\u4ed8\u56de\u8c03\u66f4\u65b0\u8ba2\u5355\u72b6\u6001<\/p>\n<p>\u5982\u679c\u7528\u6237\u6ca1\u6709\u5728\u89c4\u5b9a\u65f6\u95f4\u5185\u652f\u4ed8&#xff1a;<\/p>\n<p>RocketMQ \u5ef6\u8fdf\u6d88\u606f\u5230\u8fbe<br \/>\n    \u2193<br \/>\n\u6d88\u8d39\u7aef\u67e5\u8be2\u8ba2\u5355\u72b6\u6001<br \/>\n    \u2193<br \/>\n\u5982\u679c\u4ecd\u662f\u5f85\u652f\u4ed8&#xff0c;\u5173\u95ed\u8ba2\u5355<br \/>\n    \u2193<br \/>\n\u91ca\u653e\u5ea7\u4f4d<br \/>\n    \u2193<br \/>\n\u56de\u6eda Redis \u4f59\u7968\u548c\u4ee4\u724c\u6876<\/p>\n<p>\u8fd9\u4e2a\u94fe\u8def\u628a\u5f88\u591a\u6280\u672f\u70b9\u4e32\u5728\u4e86\u4e00\u8d77&#xff1a;<\/p>\n<table>\n<tr>\u73af\u8282\u9879\u76ee\u91cc\u7684\u6838\u5fc3\u6280\u672f<\/tr>\n<tbody>\n<tr>\n<td>\u4f59\u7968\u6821\u9a8c<\/td>\n<td>Redis Hash &#043; Lua \u4ee4\u724c\u6876<\/td>\n<\/tr>\n<tr>\n<td>\u5e76\u53d1\u6263\u51cf<\/td>\n<td>Lua \u539f\u5b50\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>\u5ea7\u4f4d\u9501\u5b9a<\/td>\n<td>\u6570\u636e\u5e93\u5ea7\u4f4d\u72b6\u6001 &#043; \u7f13\u5b58\u9884\u6263<\/td>\n<\/tr>\n<tr>\n<td>\u8ba2\u5355\u751f\u6210<\/td>\n<td>\u5206\u5e93\u5206\u8868 &#043; \u96ea\u82b1 ID<\/td>\n<\/tr>\n<tr>\n<td>\u8d85\u65f6\u5173\u5355<\/td>\n<td>RocketMQ \u5ef6\u8fdf\u6d88\u606f<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u590d\u6d88\u8d39<\/td>\n<td>\u5e42\u7b49\u6846\u67b6<\/td>\n<\/tr>\n<tr>\n<td>\u5e76\u53d1\u72b6\u6001\u4fee\u6539<\/td>\n<td>Redisson \u5206\u5e03\u5f0f\u9501<\/td>\n<\/tr>\n<tr>\n<td>\u7f13\u5b58\u4e00\u81f4\u6027<\/td>\n<td>Canal &#043; RocketMQ &#043; \u7b56\u7565\u6a21\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b66\u5b8c\u540e\u6211\u6700\u5927\u7684\u611f\u53d7\u662f&#xff1a;\u9ad8\u5e76\u53d1\u7cfb\u7edf\u4e0d\u662f\u9760\u67d0\u4e00\u4e2a\u6280\u672f\u89e3\u51b3\u95ee\u9898&#xff0c;\u800c\u662f\u9760\u4e00\u6574\u5957\u94fe\u8def\u534f\u4f5c\u3002<\/p>\n<p>Redis \u89e3\u51b3\u7684\u662f\u201c\u522b\u8ba9\u6240\u6709\u8bf7\u6c42\u90fd\u6253\u6570\u636e\u5e93\u201d\u3002<\/p>\n<p>Lua \u89e3\u51b3\u7684\u662f\u201c\u5e76\u53d1\u4e0b\u6821\u9a8c\u548c\u6263\u51cf\u5fc5\u987b\u539f\u5b50\u201d\u3002<\/p>\n<p>RocketMQ \u89e3\u51b3\u7684\u662f\u201c\u5f02\u6b65\u89e3\u8026\u548c\u5ef6\u8fdf\u8865\u507f\u201d\u3002<\/p>\n<p>\u5e42\u7b49\u89e3\u51b3\u7684\u662f\u201c\u6d88\u606f\u91cd\u590d\u3001\u8bf7\u6c42\u91cd\u590d\u4e0d\u80fd\u91cd\u590d\u6267\u884c\u4e1a\u52a1\u201d\u3002<\/p>\n<p>\u5206\u5e03\u5f0f\u9501\u89e3\u51b3\u7684\u662f\u201c\u591a\u4e2a\u8282\u70b9\u540c\u65f6\u6539\u540c\u4e00\u7b14\u8ba2\u5355\u72b6\u6001\u65f6\u4e0d\u80fd\u4e71\u201d\u3002<\/p>\n<p>Canal \u89e3\u51b3\u7684\u662f\u201c\u6570\u636e\u5e93\u53d8\u5316\u540e\u7f13\u5b58\u6700\u7ec8\u8981\u540c\u6b65\u201d\u3002<\/p>\n<p>\u8fd9\u4e9b\u6280\u672f\u70b9\u5355\u72ec\u770b\u90fd\u4e0d\u590d\u6742&#xff0c;\u4f46\u653e\u5230\u8d2d\u7968\u94fe\u8def\u91cc&#xff0c;\u624d\u4f53\u73b0\u51fa\u4ef7\u503c\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u6211\u5bf9\u201c\u9632\u8d85\u5356\u201d\u7684\u7406\u89e3\u53d1\u751f\u4e86\u53d8\u5316<\/h3>\n<p>\u4e00\u5f00\u59cb\u6211\u7406\u89e3\u7684\u9632\u8d85\u5356\u6bd4\u8f83\u7b80\u5355&#xff1a;\u5e93\u5b58\u6263\u51cf\u65f6\u52a0\u9501&#xff0c;\u6216\u8005\u6570\u636e\u5e93 update \u52a0\u6761\u4ef6\u3002<\/p>\n<p>\u4f46\u5b66\u4e60\u8fd9\u4e2a\u9879\u76ee\u540e&#xff0c;\u6211\u53d1\u73b0\u771f\u6b63\u7684\u9ad8\u5e76\u53d1\u9632\u8d85\u5356\u4e0d\u80fd\u53ea\u9760\u6570\u636e\u5e93\u3002\u539f\u56e0\u5f88\u7b80\u5355&#xff1a;\u5982\u679c\u6240\u6709\u8d2d\u7968\u8bf7\u6c42\u90fd\u76f4\u63a5\u6253\u6570\u636e\u5e93&#xff0c;\u6570\u636e\u5e93\u5f88\u5feb\u5c31\u4f1a\u625b\u4e0d\u4f4f\u3002<\/p>\n<p>\u6240\u4ee5\u9879\u76ee\u5728\u6570\u636e\u5e93\u4e4b\u524d\u505a\u4e86\u591a\u5c42\u524a\u5cf0\u548c\u9884\u6263&#xff1a;<\/p>\n<p>\u8bf7\u6c42\u8fdb\u5165<br \/>\n    \u2193<br \/>\nRedis \u4ee4\u724c\u6876\u5224\u65ad\u4f59\u7968\u662f\u5426\u8db3\u591f<br \/>\n    \u2193<br \/>\nLua \u539f\u5b50\u6263\u51cf\u4ee4\u724c<br \/>\n    \u2193<br \/>\n\u8fdb\u5165\u5ea7\u4f4d\u9501\u5b9a\u548c\u8ba2\u5355\u521b\u5efa<br \/>\n    \u2193<br \/>\n\u6570\u636e\u5e93\u6700\u7ec8\u843d\u5e93<\/p>\n<p>\u9879\u76ee\u91cc\u7684\u4ee4\u724c\u6876\u4e0d\u662f\u4f20\u7edf\u610f\u4e49\u4e0a\u201c\u6309\u56fa\u5b9a\u901f\u7387\u751f\u6210\u4ee4\u724c\u201d\u7684\u9650\u6d41\u6876&#xff0c;\u800c\u66f4\u50cf\u662f\u201c\u6309\u8f66\u6b21\u3001\u533a\u95f4\u3001\u5ea7\u4f4d\u7c7b\u578b\u7ef4\u62a4\u7684\u4f59\u7968\u4ee4\u724c\u5bb9\u5668\u201d\u3002<\/p>\n<p>\u5b83\u7684 Redis \u7ed3\u6784\u5927\u81f4\u662f&#xff1a;<\/p>\n<p>Key: ticket_availability_token_bucket:{trainId}<br \/>\nField: {startStation}_{endStation}_{seatType}<br \/>\nValue: \u5f53\u524d\u533a\u95f4\u5f53\u524d\u5ea7\u4f4d\u7c7b\u578b\u5269\u4f59\u4ee4\u724c\u6570<\/p>\n<p>\u8d2d\u7968\u65f6&#xff0c;Lua \u811a\u672c\u4f1a\u5148\u5224\u65ad\u6240\u6709\u76f8\u5173\u533a\u95f4\u7684\u4ee4\u724c\u662f\u5426\u8db3\u591f\u3002\u5982\u679c\u8db3\u591f&#xff0c;\u518d\u4e00\u6b21\u6027\u6263\u51cf\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e24\u4e2a\u52a8\u4f5c\u662f\u539f\u5b50\u7684&#xff1a;<\/p>\n<p>\u5224\u65ad\u4f59\u7968\u662f\u5426\u8db3\u591f<br \/>\n        &#043;<br \/>\n\u6263\u51cf\u4f59\u7968\u4ee4\u724c<br \/>\n        \u2193<br \/>\n\u4e00\u4e2a Lua \u811a\u672c\u5185\u5b8c\u6210&#xff0c;\u4e0d\u4f1a\u88ab\u5176\u4ed6\u8bf7\u6c42\u63d2\u5165<\/p>\n<p>\u8fd9\u8ba9\u6211\u7406\u89e3\u5230&#xff1a;\u9632\u8d85\u5356\u4e0d\u662f\u7b80\u5355\u201c\u52a0\u9501\u201d&#xff0c;\u800c\u662f\u8981\u6839\u636e\u5e76\u53d1\u91cf\u3001\u6570\u636e\u5e93\u538b\u529b\u3001\u4e1a\u52a1\u4e00\u81f4\u6027\u8981\u6c42\u7efc\u5408\u8bbe\u8ba1\u3002<\/p>\n<p>\u9879\u76ee\u91cc\u7684\u9632\u8d85\u5356\u5927\u81f4\u53ef\u4ee5\u5206\u4e09\u5c42&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u5c42\u662f Redis \u9884\u6263\u51cf&#xff0c;\u6321\u4f4f\u5927\u90e8\u5206\u65e0\u6548\u8bf7\u6c42\u3002<\/p>\n<p>\u7b2c\u4e8c\u5c42\u662f Lua \u539f\u5b50\u64cd\u4f5c&#xff0c;\u4fdd\u8bc1\u7f13\u5b58\u5c42\u4e0d\u4f1a\u5e76\u53d1\u6263\u4e71\u3002<\/p>\n<p>\u7b2c\u4e09\u5c42\u662f\u6570\u636e\u5e93\u5ea7\u4f4d\u72b6\u6001&#xff0c;\u4f5c\u4e3a\u6700\u7ec8\u515c\u5e95\u3002<\/p>\n<p>\u5982\u679c\u8ba2\u5355\u8d85\u65f6\u672a\u652f\u4ed8&#xff0c;\u8fd8\u4f1a\u901a\u8fc7\u5ef6\u8fdf\u6d88\u606f\u91ca\u653e\u5ea7\u4f4d\u5e76\u56de\u6eda\u4ee4\u724c\u6876\u3002\u8fd9\u8bf4\u660e\u9632\u8d85\u5356\u4e0d\u53ea\u5305\u542b\u201c\u6263\u51cf\u201d&#xff0c;\u8fd8\u5fc5\u987b\u5305\u542b\u201c\u56de\u6eda\u201d\u3002\u53ea\u4f1a\u6263\u4e0d\u4f1a\u56de\u6eda&#xff0c;\u7cfb\u7edf\u6700\u7ec8\u4e5f\u4f1a\u4e0d\u4e00\u81f4\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u6211\u5bf9 RocketMQ \u7684\u7406\u89e3\u4e0d\u518d\u505c\u7559\u5728\u201c\u53d1\u6d88\u606f\u201d<\/h3>\n<p>\u8fd9\u4e2a\u9879\u76ee\u91cc RocketMQ \u4e0d\u53ea\u662f\u7528\u6765\u5f02\u6b65\u53d1\u9001\u901a\u77e5&#xff0c;\u800c\u662f\u53c2\u4e0e\u4e86\u591a\u4e2a\u5173\u952e\u4e1a\u52a1\u6d41\u7a0b\u3002<\/p>\n<p>\u6211\u5370\u8c61\u6700\u6df1\u7684\u662f\u5ef6\u8fdf\u5173\u5355\u3002<\/p>\n<p>\u521b\u5efa\u8ba2\u5355\u540e&#xff0c;\u9879\u76ee\u4f1a\u53d1\u9001\u4e00\u6761\u5ef6\u8fdf\u6d88\u606f\u3002\u6d88\u606f\u5230\u671f\u540e&#xff0c;\u6d88\u8d39\u8005\u4f1a\u68c0\u67e5\u8ba2\u5355\u72b6\u6001&#xff1a;<\/p>\n<ul>\n<li>\u5982\u679c\u8ba2\u5355\u4ecd\u7136\u662f\u5f85\u652f\u4ed8&#xff0c;\u5c31\u5173\u95ed\u8ba2\u5355\u3001\u91ca\u653e\u5ea7\u4f4d\u3001\u56de\u6eda\u4f59\u7968\u3002<\/li>\n<li>\u5982\u679c\u8ba2\u5355\u5df2\u7ecf\u652f\u4ed8&#xff0c;\u5c31\u76f4\u63a5\u8df3\u8fc7\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u8ba9\u6211\u7406\u89e3\u5230&#xff0c;\u5ef6\u8fdf\u6d88\u606f\u672c\u8d28\u4e0a\u662f\u5728\u505a\u4e00\u79cd\u201c\u672a\u6765\u67d0\u4e2a\u65f6\u95f4\u70b9\u7684\u4e1a\u52a1\u8865\u507f\u201d\u3002<\/p>\n<p>\u5982\u679c\u4e0d\u7528 MQ&#xff0c;\u4e5f\u53ef\u4ee5\u7528\u5b9a\u65f6\u4efb\u52a1\u626b\u8868&#xff0c;\u6bd4\u5982\u6bcf\u5206\u949f\u626b\u63cf\u4e00\u6b21\u8d85\u65f6\u8ba2\u5355\u3002\u4f46\u5b9a\u65f6\u4efb\u52a1\u6709\u51e0\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u626b\u8868\u6210\u672c\u9ad8&#xff0c;\u8ba2\u5355\u91cf\u5927\u65f6\u538b\u529b\u660e\u663e\u3002<\/li>\n<li>\u65f6\u95f4\u7cbe\u5ea6\u4e0d\u7a33\u5b9a&#xff0c;\u53ef\u80fd\u5ef6\u8fdf\u8f83\u5927\u3002<\/li>\n<li>\u591a\u5b9e\u4f8b\u90e8\u7f72\u65f6\u8fd8\u8981\u89e3\u51b3\u91cd\u590d\u626b\u63cf\u548c\u5e76\u53d1\u5904\u7406\u3002<\/li>\n<\/ul>\n<p>\u5ef6\u8fdf\u6d88\u606f\u7684\u4f18\u52bf\u662f&#xff1a;\u6bcf\u4e2a\u8ba2\u5355\u521b\u5efa\u65f6\u5c31\u7ed1\u5b9a\u4e00\u6761\u672a\u6765\u8981\u6267\u884c\u7684\u68c0\u67e5\u4efb\u52a1&#xff0c;\u5230\u70b9\u540e\u6d88\u8d39\u5373\u53ef\u3002<\/p>\n<p>\u4e0d\u8fc7\u5b66\u4e60\u6e90\u7801\u65f6\u6211\u4e5f\u6ce8\u610f\u5230\u4e00\u4e2a\u7ec6\u8282&#xff1a;RocketMQ \u7684\u5ef6\u8fdf\u7ea7\u522b\u4e0d\u662f\u4efb\u610f\u65f6\u95f4&#xff0c;\u800c\u662f\u56fa\u5b9a\u7b49\u7ea7\u3002\u9879\u76ee\u4ee3\u7801\u91cc\u7528\u4e86 delayLevel(14)&#xff0c;\u6309 RocketMQ \u9ed8\u8ba4\u914d\u7f6e\u5bf9\u5e94\u7684\u662f 10 \u5206\u949f&#xff0c;\u4e0d\u662f 30 \u5206\u949f\u3002\u5982\u679c\u8981 30 \u5206\u949f&#xff0c;\u9ed8\u8ba4\u5e94\u8be5\u7528 level 16\u3002<\/p>\n<p>\u8fd9\u4e2a\u70b9\u8ba9\u6211\u610f\u8bc6\u5230&#xff1a;\u5b66\u4e60\u9879\u76ee\u4e0d\u80fd\u53ea\u770b\u6ce8\u91ca&#xff0c;\u8fd8\u8981\u7ed3\u5408\u6846\u67b6\u672c\u8eab\u7684\u673a\u5236\u6838\u5bf9\u3002<\/p>\n<p>RocketMQ \u5728\u9879\u76ee\u91cc\u8fd8\u6709\u4e00\u4e2a\u91cd\u8981\u4ef7\u503c\u662f\u89e3\u8026\u3002<\/p>\n<p>\u6bd4\u5982\u652f\u4ed8\u670d\u52a1\u6536\u5230\u652f\u4ed8\u56de\u8c03\u540e&#xff0c;\u4e0d\u5e94\u8be5\u76f4\u63a5\u5f3a\u8026\u5408\u8ba2\u5355\u670d\u52a1\u5185\u90e8\u903b\u8f91&#xff0c;\u800c\u662f\u901a\u8fc7\u6d88\u606f\u901a\u77e5\u8ba2\u5355\u670d\u52a1\u5904\u7406\u652f\u4ed8\u7ed3\u679c\u3002\u8fd9\u6837\u652f\u4ed8\u548c\u8ba2\u5355\u4e4b\u95f4\u7684\u8026\u5408\u4f1a\u66f4\u4f4e&#xff0c;\u540e\u7eed\u6269\u5c55\u4e5f\u66f4\u65b9\u4fbf\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u5e42\u7b49\u6846\u67b6\u662f\u6211\u89c9\u5f97\u6700\u503c\u5f97\u5b66\u4e60\u7684\u5de5\u7a0b\u5316\u8bbe\u8ba1\u4e4b\u4e00<\/h3>\n<p>\u9ad8\u5e76\u53d1\u7cfb\u7edf\u91cc&#xff0c;\u8bf7\u6c42\u91cd\u590d\u548c\u6d88\u606f\u91cd\u590d\u662f\u5f88\u5e38\u89c1\u7684\u3002<\/p>\n<p>\u6bd4\u5982&#xff1a;<\/p>\n<ul>\n<li>\u7528\u6237\u8fde\u7eed\u70b9\u51fb\u63d0\u4ea4\u6309\u94ae\u3002<\/li>\n<li>\u7f51\u7edc\u6296\u52a8\u5bfc\u81f4\u524d\u7aef\u91cd\u8bd5\u3002<\/li>\n<li>MQ \u6d88\u8d39\u5931\u8d25\u540e\u91cd\u65b0\u6295\u9012\u3002<\/li>\n<li>\u670d\u52a1\u8d85\u65f6\u540e\u8c03\u7528\u65b9\u518d\u6b21\u53d1\u8d77\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u6ca1\u6709\u5e42\u7b49\u4fdd\u62a4&#xff0c;\u540c\u4e00\u4e2a\u4e1a\u52a1\u53ef\u80fd\u88ab\u6267\u884c\u591a\u6b21\u3002\u5bf9\u8d2d\u7968\u7cfb\u7edf\u6765\u8bf4&#xff0c;\u8fd9\u53ef\u80fd\u5bfc\u81f4\u91cd\u590d\u4e0b\u5355\u3001\u91cd\u590d\u91ca\u653e\u5ea7\u4f4d\u3001\u91cd\u590d\u56de\u6eda\u5e93\u5b58\u7b49\u95ee\u9898\u3002<\/p>\n<p>\u9879\u76ee\u91cc\u5c01\u88c5\u4e86\u4e00\u4e2a\u901a\u7528\u5e42\u7b49\u6846\u67b6&#xff0c;\u6838\u5fc3\u662f&#xff1a;<\/p>\n<p>&#064;Idempotent \u6ce8\u89e3<br \/>\n        \u2193<br \/>\nAOP \u62e6\u622a\u65b9\u6cd5<br \/>\n        \u2193<br \/>\n\u6839\u636e\u6ce8\u89e3\u7c7b\u578b\u9009\u62e9\u5904\u7406\u5668<br \/>\n        \u2193<br \/>\n\u751f\u6210\u552f\u4e00\u5e42\u7b49 key<br \/>\n        \u2193<br \/>\nRedis \u539f\u5b50\u5199\u5165 key<br \/>\n        \u2193<br \/>\nkey \u5df2\u5b58\u5728\u5219\u8bf4\u660e\u91cd\u590d\u8bf7\u6c42<\/p>\n<p>\u5b83\u652f\u6301\u4e09\u7c7b\u5e42\u7b49\u65b9\u5f0f&#xff1a;<\/p>\n<table>\n<tr>\u7c7b\u578b\u9002\u7528\u573a\u666f\u6211\u7684\u7406\u89e3<\/tr>\n<tbody>\n<tr>\n<td>PARAM<\/td>\n<td>HTTP \u53c2\u6570\u5e42\u7b49<\/td>\n<td>\u6839\u636e\u8bf7\u6c42\u53c2\u6570\u751f\u6210\u552f\u4e00\u6807\u8bc6<\/td>\n<\/tr>\n<tr>\n<td>TOKEN<\/td>\n<td>\u8868\u5355\u9632\u91cd\u590d\u63d0\u4ea4<\/td>\n<td>\u5148\u7533\u8bf7 token&#xff0c;\u518d\u63d0\u4ea4\u65f6\u6d88\u8d39 token<\/td>\n<\/tr>\n<tr>\n<td>SPEL<\/td>\n<td>\u7075\u6d3b\u8868\u8fbe\u5f0f<\/td>\n<td>MQ \u6216\u590d\u6742\u5bf9\u8c61\u573a\u666f\u4e0b\u7528 SpEL \u53d6\u5b57\u6bb5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u89c9\u5f97\u8fd9\u4e2a\u8bbe\u8ba1\u6700\u6709\u4ef7\u503c\u7684\u5730\u65b9\u662f&#xff1a;\u5b83\u4e0d\u662f\u5728\u4e1a\u52a1\u4ee3\u7801\u91cc\u5230\u5904\u5199 Redis \u5224\u65ad&#xff0c;\u800c\u662f\u901a\u8fc7\u6ce8\u89e3\u548c AOP \u505a\u6210\u4e86\u6846\u67b6\u80fd\u529b\u3002<\/p>\n<p>\u4e1a\u52a1\u65b9\u6cd5\u53ea\u9700\u8981\u8fd9\u6837\u6807\u8bb0&#xff1a;<\/p>\n<p><span class=\"token annotation punctuation\">&#064;Idempotent<\/span><span class=\"token punctuation\">(<\/span><br \/>\n    uniqueKeyPrefix <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;index12306-ticket:delay_close_order:&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    key <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;#message.getKeys() &#043; &#039;_&#039; &#043; #message.hashCode()&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    type <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">IdempotentTypeEnum<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">SPEL<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    scene <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">IdempotentSceneEnum<\/span><span class=\"token punctuation\">.<\/span><span class=\"token constant\">MQ<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    keyTimeout <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">7200L<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u5269\u4e0b\u7684\u4e8b\u60c5\u4ea4\u7ed9\u6846\u67b6\u3002<\/p>\n<p>\u8fd9\u8ba9\u6211\u7406\u89e3\u5230&#xff1a;\u5de5\u7a0b\u5316\u80fd\u529b\u7684\u4e00\u4e2a\u91cd\u8981\u4f53\u73b0&#xff0c;\u5c31\u662f\u628a\u6a2a\u5207\u903b\u8f91\u4ece\u4e1a\u52a1\u4ee3\u7801\u4e2d\u62bd\u51fa\u6765\u3002\u5e42\u7b49\u3001\u65e5\u5fd7\u3001\u5f02\u5e38\u3001\u9274\u6743\u3001\u9650\u6d41\u90fd\u5c5e\u4e8e\u8fd9\u7c7b\u6a2a\u5207\u903b\u8f91\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u7b56\u7565\u6a21\u5f0f\u8ba9\u6211\u7406\u89e3\u4e86\u201c\u5c11\u5199 if-else\u201d\u7684\u771f\u6b63\u610f\u4e49<\/h3>\n<p>\u4ee5\u524d\u6211\u7406\u89e3\u7b56\u7565\u6a21\u5f0f\u65f6&#xff0c;\u66f4\u591a\u505c\u7559\u5728\u8bbe\u8ba1\u6a21\u5f0f\u4e66\u4e0a\u7684\u4f8b\u5b50&#xff0c;\u6bd4\u5982\u4e0d\u540c\u652f\u4ed8\u65b9\u5f0f\u3001\u4e0d\u540c\u6298\u6263\u7b56\u7565\u3002<\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u91cc\u7b56\u7565\u6a21\u5f0f\u7684\u843d\u5730\u66f4\u5de5\u7a0b\u5316\u3002<\/p>\n<p>\u9879\u76ee\u5c01\u88c5\u4e86\u4e24\u4e2a\u6838\u5fc3\u7c7b&#xff1a;<\/p>\n<p>AbstractExecuteStrategy<br \/>\nAbstractStrategyChoose<\/p>\n<p>\u6240\u6709\u7b56\u7565\u5904\u7406\u5668\u5b9e\u73b0 AbstractExecuteStrategy&#xff0c;\u5e76\u901a\u8fc7 mark() \u8fd4\u56de\u81ea\u5df1\u7684\u6807\u8bc6\u3002\u9879\u76ee\u542f\u52a8\u65f6&#xff0c;AbstractStrategyChoose \u4f1a\u4ece Spring \u5bb9\u5668\u4e2d\u62ff\u5230\u6240\u6709\u7b56\u7565 Bean&#xff0c;\u653e\u8fdb\u4e00\u4e2a Map&#xff1a;<\/p>\n<p>Map&lt;mark, \u7b56\u7565\u5b9e\u4f8b&gt;<\/p>\n<p>\u8fd0\u884c\u65f6\u6839\u636e mark \u627e\u5230\u5bf9\u5e94\u7b56\u7565\u6267\u884c\u3002<\/p>\n<p>\u6211\u89c9\u5f97\u8fd9\u4e2a\u8bbe\u8ba1\u6700\u5178\u578b\u7684\u5e94\u7528\u662f Canal binlog \u540c\u6b65\u7f13\u5b58\u3002<\/p>\n<p>Canal \u6d88\u8d39\u8005\u62ff\u5230 binlog \u6d88\u606f\u540e&#xff0c;\u5e76\u4e0d\u76f4\u63a5\u5199&#xff1a;<\/p>\n<p><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>table<span class=\"token punctuation\">.<\/span><span class=\"token function\">equals<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;t_seat&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u66f4\u65b0\u4f59\u7968\u7f13\u5b58<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>table<span class=\"token punctuation\">.<\/span><span class=\"token function\">equals<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;t_order&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u8ba2\u5355\u5173\u95ed\u56de\u6eda<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u800c\u662f&#xff1a;<\/p>\n<p>abstractStrategyChoose<span class=\"token punctuation\">.<\/span><span class=\"token function\">chooseAndExecute<\/span><span class=\"token punctuation\">(<\/span>message<span class=\"token punctuation\">.<\/span><span class=\"token function\">getTable<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> message<span class=\"token punctuation\">,<\/span> predicateFlag<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u7136\u540e\u4e0d\u540c\u8868\u5bf9\u5e94\u4e0d\u540c\u5904\u7406\u5668&#xff1a;<\/p>\n<ul>\n<li>TicketAvailabilityCacheUpdateHandler \u5904\u7406\u5ea7\u4f4d\u8868\u53d8\u5316\u3002<\/li>\n<li>OrderCloseCacheAndTokenUpdateHandler \u5904\u7406\u8ba2\u5355\u5173\u95ed\u540e\u7684\u7f13\u5b58\u548c\u4ee4\u724c\u6876\u56de\u6eda\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u8ba9\u6211\u7406\u89e3\u5230&#xff1a;\u7b56\u7565\u6a21\u5f0f\u4e0d\u662f\u4e3a\u4e86\u201c\u770b\u8d77\u6765\u9ad8\u7ea7\u201d&#xff0c;\u800c\u662f\u4e3a\u4e86\u628a\u53d8\u5316\u70b9\u9694\u79bb\u51fa\u6765\u3002<\/p>\n<p>\u5982\u679c\u540e\u7eed\u65b0\u589e\u4e00\u5f20\u8868\u7684 binlog \u540c\u6b65\u903b\u8f91&#xff0c;\u4e0d\u9700\u8981\u6539\u6d88\u8d39\u8005\u4e3b\u6d41\u7a0b&#xff0c;\u53ea\u9700\u8981\u65b0\u589e\u4e00\u4e2a\u7b56\u7565\u5904\u7406\u5668\u5373\u53ef\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u5f00\u95ed\u539f\u5219\u5728\u9879\u76ee\u91cc\u7684\u771f\u5b9e\u4f53\u73b0\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001Canal &#043; MQ \u8ba9\u6211\u7406\u89e3\u4e86\u7f13\u5b58\u4e00\u81f4\u6027\u7684\u53e6\u4e00\u79cd\u65b9\u6848<\/h3>\n<p>\u5728\u9879\u76ee\u91cc&#xff0c;Redis \u7f13\u5b58\u4e0d\u662f\u7b80\u5355\u5730\u5728\u4e1a\u52a1\u4ee3\u7801\u91cc\u624b\u52a8\u66f4\u65b0\u3002\u9879\u76ee\u4f7f\u7528 Canal \u76d1\u542c MySQL binlog&#xff0c;\u518d\u901a\u8fc7 RocketMQ \u628a\u53d8\u66f4\u4e8b\u4ef6\u53d1\u9001\u51fa\u6765&#xff0c;\u7531\u6d88\u8d39\u8005\u66f4\u65b0 Redis\u3002<\/p>\n<p>\u5b8c\u6574\u94fe\u8def\u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>\u4e1a\u52a1\u66f4\u65b0 MySQL<br \/>\n    \u2193<br \/>\nMySQL \u5199 binlog<br \/>\n    \u2193<br \/>\nCanal \u76d1\u542c binlog<br \/>\n    \u2193<br \/>\nCanal \u6295\u9012 MQ \u6d88\u606f<br \/>\n    \u2193<br \/>\n\u9879\u76ee\u6d88\u8d39\u8005\u6d88\u8d39\u6d88\u606f<br \/>\n    \u2193<br \/>\n\u6839\u636e\u8868\u540d\u8def\u7531\u5230\u4e0d\u540c\u7b56\u7565\u5904\u7406\u5668<br \/>\n    \u2193<br \/>\n\u66f4\u65b0 Redis \u7f13\u5b58<\/p>\n<p>\u8fd9\u4e2a\u8bbe\u8ba1\u7684\u597d\u5904\u662f&#xff1a;\u4e1a\u52a1\u4ee3\u7801\u4e0d\u7528\u5f3a\u4f9d\u8d56 Redis \u66f4\u65b0\u903b\u8f91\u3002\u6570\u636e\u5e93\u53d1\u751f\u53d8\u5316\u540e&#xff0c;\u901a\u8fc7 binlog \u9a71\u52a8\u7f13\u5b58\u540c\u6b65\u3002<\/p>\n<p>\u6211\u89c9\u5f97\u5b83\u9002\u5408\u51e0\u4e2a\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>\u591a\u4e2a\u670d\u52a1\u90fd\u53ef\u80fd\u4fee\u6539\u6570\u636e\u5e93&#xff0c;\u4f46\u7f13\u5b58\u66f4\u65b0\u903b\u8f91\u5e0c\u671b\u7edf\u4e00\u3002<\/li>\n<li>\u4e0d\u60f3\u628a\u7f13\u5b58\u540c\u6b65\u4ee3\u7801\u6563\u843d\u5728\u4e1a\u52a1\u903b\u8f91\u91cc\u3002<\/li>\n<li>\u63a5\u53d7\u77ed\u6682\u5ef6\u8fdf&#xff0c;\u8ffd\u6c42\u6700\u7ec8\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n<p>\u4f46\u8fd9\u4e2a\u65b9\u6848\u4e5f\u4e0d\u662f\u6ca1\u6709\u4ee3\u4ef7\u3002<\/p>\n<p>\u5b83\u662f\u5f02\u6b65\u7684&#xff0c;\u6240\u4ee5\u4e00\u5b9a\u5b58\u5728\u5ef6\u8fdf\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u6570\u636e\u5e93\u66f4\u65b0\u6210\u529f\u540e&#xff0c;Redis \u53ef\u80fd\u77ed\u65f6\u95f4\u5185\u8fd8\u662f\u65e7\u6570\u636e\u3002\u56e0\u6b64\u8fd9\u79cd\u65b9\u6848\u66f4\u9002\u5408\u6700\u7ec8\u4e00\u81f4\u6027\u573a\u666f&#xff0c;\u4e0d\u9002\u5408\u5f3a\u4e00\u81f4\u8bfb\u5199\u3002<\/p>\n<p>\u9879\u76ee\u91cc\u901a\u8fc7\u7b56\u7565\u6a21\u5f0f\u5904\u7406\u4e0d\u540c\u8868\u7684 binlog&#xff0c;\u6211\u89c9\u5f97\u8fd9\u662f Canal \u8fd9\u6761\u94fe\u8def\u91cc\u6bd4\u8f83\u597d\u7684\u8bbe\u8ba1&#xff1a;\u6d88\u8d39\u8005\u53ea\u8d1f\u8d23\u63a5\u6536\u4e8b\u4ef6&#xff0c;\u5177\u4f53\u600e\u4e48\u66f4\u65b0\u7f13\u5b58\u4ea4\u7ed9\u7b56\u7565\u5904\u7406\u5668\u3002<\/p>\n<hr \/>\n<h3>\u516b\u3001\u5206\u5e93\u5206\u8868\u8ba9\u6211\u7406\u89e3\u4e86\u201c\u5206\u7247\u952e\u6bd4\u6846\u67b6\u66f4\u91cd\u8981\u201d<\/h3>\n<p>\u8fd9\u4e2a\u9879\u76ee\u91cc\u8ba2\u5355\u670d\u52a1\u548c\u7528\u6237\u670d\u52a1\u90fd\u4f7f\u7528\u4e86 ShardingSphere\u3002<\/p>\n<p>\u8ba2\u5355\u670d\u52a1\u662f 2 \u5e93 32 \u8868&#xff0c;\u8ba2\u5355\u8868\u6309 user_id &#043; order_sn \u590d\u5408\u5206\u7247\u3002<\/p>\n<p>\u7528\u6237\u670d\u52a1\u4e5f\u662f 2 \u5e93 32 \u8868&#xff0c;\u4f46\u4e0d\u540c\u8868\u5206\u7247\u952e\u4e0d\u540c&#xff1a;<\/p>\n<ul>\n<li>t_user \u6309 username<\/li>\n<li>t_passenger \u6309 username<\/li>\n<li>t_user_mail \u6309 mail<\/li>\n<li>t_user_phone \u6309 phone<\/li>\n<\/ul>\n<p>\u5b66\u4e60\u8fd9\u90e8\u5206\u540e&#xff0c;\u6211\u6700\u5927\u7684\u6536\u83b7\u662f&#xff1a;\u5206\u5e93\u5206\u8868\u6700\u91cd\u8981\u7684\u4e0d\u662f\u914d\u7f6e\u8bed\u6cd5&#xff0c;\u800c\u662f\u5206\u7247\u952e\u9009\u62e9\u3002<\/p>\n<p>\u5982\u679c\u7528\u6237\u8ba2\u5355\u5217\u8868\u67e5\u8be2\u6700\u5e38\u5e26\u7684\u662f user_id&#xff0c;\u90a3\u8ba2\u5355\u8868\u5c31\u5e94\u8be5\u4f18\u5148\u8003\u8651 user_id\u3002<\/p>\n<p>\u5982\u679c\u652f\u4ed8\u56de\u8c03\u53ea\u62ff\u5f97\u5230 order_sn&#xff0c;\u90a3\u7b97\u6cd5\u4e5f\u9700\u8981\u517c\u5bb9 order_sn\u3002<\/p>\n<p>\u5982\u679c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u624b\u673a\u53f7\u767b\u5f55&#xff0c;\u5c31\u9700\u8981\u8ba9\u624b\u673a\u53f7\u67e5\u8be2\u80fd\u7cbe\u51c6\u8def\u7531&#xff0c;\u6240\u4ee5\u9879\u76ee\u5355\u72ec\u8bbe\u8ba1\u4e86 t_user_phone\u3002<\/p>\n<p>\u8fd9\u8ba9\u6211\u610f\u8bc6\u5230&#xff1a;\u5206\u7247\u952e\u4e00\u5b9a\u8981\u4ece\u4e1a\u52a1\u67e5\u8be2\u8def\u5f84\u51fa\u53d1&#xff0c;\u800c\u4e0d\u662f\u4ece\u6570\u636e\u5e93\u89d2\u5ea6\u62cd\u8111\u888b\u51b3\u5b9a\u3002<\/p>\n<p>\u5206\u5e93\u5206\u8868\u4e5f\u6709\u4ee3\u4ef7&#xff1a;<\/p>\n<ul>\n<li>\u8de8\u5e93\u805a\u5408\u67e5\u8be2\u53d8\u590d\u6742\u3002<\/li>\n<li>\u5206\u9875\u3001\u6392\u5e8f\u3001\u7edf\u8ba1\u4f1a\u66f4\u9ebb\u70e6\u3002<\/li>\n<li>\u5206\u7247\u952e\u7f3a\u5931\u65f6\u53ef\u80fd\u5bfc\u81f4\u5168\u8def\u7531\u3002<\/li>\n<li>\u540e\u7eed\u6269\u5bb9\u548c\u6570\u636e\u8fc1\u79fb\u4e5f\u9700\u8981\u8003\u8651\u3002<\/li>\n<\/ul>\n<p>\u6240\u4ee5\u5206\u5e93\u5206\u8868\u4e0d\u662f\u8d8a\u65e9\u8d8a\u597d&#xff0c;\u4e5f\u4e0d\u662f\u8868\u8d8a\u591a\u8d8a\u597d\u3002\u53ea\u6709\u5f53\u6570\u636e\u89c4\u6a21\u3001\u5199\u5165\u538b\u529b\u3001\u5355\u5e93\u74f6\u9888\u771f\u7684\u51fa\u73b0\u65f6&#xff0c;\u624d\u503c\u5f97\u5f15\u5165\u3002<\/p>\n<hr \/>\n<h3>\u4e5d\u3001\u8ba2\u5355\u51b7\u70ed\u5206\u79bb\u8ba9\u6211\u7406\u89e3\u4e86\u201c\u903b\u8f91\u5206\u79bb\u201d\u548c\u201c\u7269\u7406\u5206\u79bb\u201d\u7684\u533a\u522b<\/h3>\n<p>\u9879\u76ee\u4e2d\u8ba2\u5355\u6570\u636e\u5e76\u6ca1\u6709\u771f\u6b63\u8fc1\u79fb\u5230\u51b7\u70ed\u4e24\u5957\u7269\u7406\u8868&#xff0c;\u800c\u662f\u901a\u8fc7\u8ba2\u5355\u72b6\u6001\u505a\u903b\u8f91\u51b7\u70ed\u5206\u79bb\u3002<\/p>\n<p>\u8ba2\u5355\u72b6\u6001\u5927\u81f4\u5305\u62ec&#xff1a;<\/p>\n<p>0  \u5f85\u652f\u4ed8<br \/>\n10 \u5df2\u652f\u4ed8<br \/>\n11 \u90e8\u5206\u9000\u6b3e<br \/>\n12 \u5168\u90e8\u9000\u6b3e<br \/>\n20 \u5df2\u5b8c\u6210<br \/>\n30 \u5df2\u5173\u95ed<\/p>\n<p>\u6211\u7684\u7406\u89e3\u662f&#xff1a;<\/p>\n<ul>\n<li>\u5f85\u652f\u4ed8\u3001\u5df2\u652f\u4ed8\u3001\u9000\u6b3e\u4e2d\u5c5e\u4e8e\u7528\u6237\u8fd1\u671f\u53ef\u80fd\u64cd\u4f5c\u7684\u6570\u636e&#xff0c;\u662f\u70ed\u6570\u636e\u3002<\/li>\n<li>\u5df2\u5b8c\u6210\u3001\u5df2\u5173\u95ed\u5c5e\u4e8e\u5386\u53f2\u6570\u636e&#xff0c;\u662f\u51b7\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u67e5\u8be2\u8ba2\u5355\u65f6&#xff0c;\u524d\u7aef\u4f20 statusType&#xff0c;\u540e\u7aef\u6839\u636e\u5b83\u8f6c\u6362\u6210\u4e0d\u540c\u7684\u8ba2\u5355\u72b6\u6001\u96c6\u5408\u3002<\/p>\n<p>\u6bd4\u5982&#xff1a;<\/p>\n<p>statusType &#061; 0 -&gt; \u5f85\u652f\u4ed8<br \/>\nstatusType &#061; 1 -&gt; \u5df2\u652f\u4ed8\/\u9000\u6b3e\u4e2d<br \/>\nstatusType &#061; 2 -&gt; \u5df2\u5b8c\u6210<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u7b80\u5355&#xff0c;\u4e0d\u9700\u8981\u989d\u5916\u7684\u5f52\u6863\u4efb\u52a1&#xff0c;\u4e5f\u4e0d\u9700\u8981\u7ef4\u62a4\u51b7\u70ed\u4e24\u5957\u8868\u3002<\/p>\n<p>\u4f46\u7f3a\u70b9\u4e5f\u660e\u663e&#xff1a;\u6570\u636e\u8fd8\u662f\u5728\u540c\u4e00\u7ec4\u5206\u7247\u8868\u91cc&#xff0c;\u968f\u7740\u5386\u53f2\u8ba2\u5355\u8d8a\u6765\u8d8a\u591a&#xff0c;\u4e3b\u8868\u538b\u529b\u4ecd\u7136\u4f1a\u4e0a\u5347\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u8ba4\u4e3a\u8fd9\u4e2a\u9879\u76ee\u91cc\u7684\u51b7\u70ed\u5206\u79bb\u66f4\u51c6\u786e\u5730\u8bf4\u662f\u201c\u903b\u8f91\u51b7\u70ed\u5206\u79bb\u201d\u3002\u5982\u679c\u672a\u6765\u6570\u636e\u91cf\u7ee7\u7eed\u589e\u957f&#xff0c;\u53ef\u4ee5\u6f14\u8fdb\u6210\u7269\u7406\u51b7\u70ed\u5206\u79bb&#xff1a;<\/p>\n<ul>\n<li>\u4e3b\u8ba2\u5355\u8868\u53ea\u4fdd\u7559\u8fd1\u671f\u8ba2\u5355\u3002<\/li>\n<li>\u5386\u53f2\u8ba2\u5355\u8fc1\u79fb\u5230 t_order_history\u3002<\/li>\n<li>\u590d\u6742\u5386\u53f2\u67e5\u8be2\u8d70 ES \u6216\u5f52\u6863\u5e93\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u8ba9\u6211\u7406\u89e3\u5230&#xff1a;\u5f88\u591a\u9879\u76ee\u91cc\u7684\u8bbe\u8ba1\u662f\u5206\u9636\u6bb5\u6f14\u8fdb\u7684\u3002\u4e0d\u662f\u4e00\u5f00\u59cb\u5c31\u4e0a\u6700\u590d\u6742\u65b9\u6848&#xff0c;\u800c\u662f\u5148\u7528\u7b80\u5355\u65b9\u6848\u6ee1\u8db3\u5f53\u524d\u89c4\u6a21&#xff0c;\u518d\u7ed9\u672a\u6765\u6f14\u8fdb\u7559\u7a7a\u95f4\u3002<\/p>\n<hr \/>\n<h3>\u5341\u3001\u5168\u5c40\u5f02\u5e38\u548c\u7edf\u4e00\u8fd4\u56de\u8ba9\u6211\u7406\u89e3\u4e86\u6846\u67b6\u5c01\u88c5\u7684\u4ef7\u503c<\/h3>\n<p>\u9879\u76ee\u91cc\u5c01\u88c5\u4e86\u7edf\u4e00\u8fd4\u56de\u5bf9\u8c61\u3001\u5168\u5c40\u5f02\u5e38\u5904\u7406\u5668\u3001\u81ea\u5b9a\u4e49\u5f02\u5e38\u4f53\u7cfb\u3002<\/p>\n<p>\u4ee5\u524d\u6211\u89c9\u5f97\u8fd9\u4e9b\u4e1c\u897f\u6bd4\u8f83\u57fa\u7840&#xff0c;\u4f46\u770b\u5b8c\u6574\u4e2a\u9879\u76ee\u540e&#xff0c;\u6211\u53d1\u73b0\u5b83\u4eec\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u7edf\u4e00\u5f02\u5e38\u5904\u7406&#xff0c;\u4e1a\u52a1\u4ee3\u7801\u91cc\u4f1a\u5230\u5904\u51fa\u73b0&#xff1a;<\/p>\n<p><span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ business<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Exception<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token class-name\">Result<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">fail<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;xxx&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u8fd9\u6837\u4f1a\u5bfc\u81f4&#xff1a;<\/p>\n<ul>\n<li>\u4ee3\u7801\u91cd\u590d\u3002<\/li>\n<li>\u8fd4\u56de\u683c\u5f0f\u4e0d\u7edf\u4e00\u3002<\/li>\n<li>\u9519\u8bef\u7801\u96be\u7ba1\u7406\u3002<\/li>\n<li>\u672a\u77e5\u5f02\u5e38\u53ef\u80fd\u66b4\u9732\u5185\u90e8\u7ec6\u8282\u3002<\/li>\n<\/ul>\n<p>\u9879\u76ee\u91cc\u901a\u8fc7 &#064;RestControllerAdvice \u7edf\u4e00\u62e6\u622a&#xff1a;<\/p>\n<ul>\n<li>\u53c2\u6570\u6821\u9a8c\u5f02\u5e38<\/li>\n<li>\u4e1a\u52a1\u5f02\u5e38<\/li>\n<li>\u8fdc\u7a0b\u8c03\u7528\u5f02\u5e38<\/li>\n<li>\u672a\u77e5\u7cfb\u7edf\u5f02\u5e38<\/li>\n<\/ul>\n<p>\u4e1a\u52a1\u5c42\u53ea\u9700\u8981\u629b\u51fa ServiceException\u3001ClientException\u3001RemoteException&#xff0c;\u6846\u67b6\u5c42\u7edf\u4e00\u8f6c\u6362\u6210 Result\u3002<\/p>\n<p>\u6211\u5bf9\u8fd9\u5757\u6700\u5927\u7684\u611f\u53d7\u662f&#xff1a;\u6210\u719f\u9879\u76ee\u91cc&#xff0c;\u4e1a\u52a1\u4ee3\u7801\u5e94\u8be5\u5c3d\u91cf\u53ea\u8868\u8fbe\u4e1a\u52a1\u903b\u8f91&#xff0c;\u901a\u7528\u80fd\u529b\u5e94\u8be5\u6c89\u5230\u6846\u67b6\u5c42\u3002<\/p>\n<p>\u8fd9\u4e5f\u662f\u9879\u76ee\u91cc\u591a\u4e2a starter \u7684\u610f\u4e49&#xff1a;<\/p>\n<p>common<br \/>\nconvention<br \/>\nweb<br \/>\ndatabase<br \/>\ncache<br \/>\ndistributedid<br \/>\ndesignpattern<br \/>\nidempotent<br \/>\nlog<br \/>\nbizs<br \/>\nuser<\/p>\n<p>\u8fd9\u4e9b starter \u4e0d\u662f\u4e3a\u4e86\u62c6\u76ee\u5f55&#xff0c;\u800c\u662f\u4e3a\u4e86\u628a\u901a\u7528\u80fd\u529b\u6807\u51c6\u5316\u3002<\/p>\n<hr \/>\n<h3>\u5341\u4e00\u3001\u654f\u611f\u6570\u636e\u4fdd\u62a4\u8ba9\u6211\u7406\u89e3\u4e86\u201c\u5b58\u50a8\u5b89\u5168\u201d\u548c\u201c\u5c55\u793a\u5b89\u5168\u201d<\/h3>\n<p>\u9879\u76ee\u91cc\u5bf9\u654f\u611f\u6570\u636e\u505a\u4e86\u4e24\u5c42\u4fdd\u62a4&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u5c42\u662f\u6570\u636e\u5e93\u52a0\u5bc6\u3002<\/p>\n<p>\u7528\u6237\u670d\u52a1\u548c\u8ba2\u5355\u670d\u52a1\u7684 ShardingSphere \u914d\u7f6e\u91cc&#xff0c;\u5bf9\u8eab\u4efd\u8bc1\u3001\u624b\u673a\u53f7\u3001\u90ae\u7bb1\u3001\u5730\u5740\u7b49\u5b57\u6bb5\u914d\u7f6e\u4e86 AES \u52a0\u5bc6\u3002\u8fd9\u6837\u5373\u4f7f\u6570\u636e\u5e93\u6cc4\u9732&#xff0c;\u4e5f\u4e0d\u81f3\u4e8e\u76f4\u63a5\u66b4\u9732\u660e\u6587\u3002<\/p>\n<p>\u7b2c\u4e8c\u5c42\u662f\u63a5\u53e3\u8fd4\u56de\u8131\u654f\u3002<\/p>\n<p>\u9879\u76ee\u901a\u8fc7 Jackson \u81ea\u5b9a\u4e49\u5e8f\u5217\u5316\u5668&#xff0c;\u5bf9\u624b\u673a\u53f7\u548c\u8eab\u4efd\u8bc1\u53f7\u505a\u8131\u654f&#xff1a;<\/p>\n<ul>\n<li>\u624b\u673a\u53f7\u7c7b\u4f3c 138****5678<\/li>\n<li>\u8eab\u4efd\u8bc1\u4fdd\u7559\u524d 4 \u4f4d\u548c\u540e 4 \u4f4d<\/li>\n<\/ul>\n<p>\u8fd9\u8ba9\u6211\u7406\u89e3\u5230&#xff1a;\u52a0\u5bc6\u548c\u8131\u654f\u4e0d\u662f\u4e00\u56de\u4e8b\u3002<\/p>\n<p>\u52a0\u5bc6\u89e3\u51b3\u7684\u662f\u843d\u5e93\u5b89\u5168\u3002<\/p>\n<p>\u8131\u654f\u89e3\u51b3\u7684\u662f\u5c55\u793a\u5b89\u5168\u3002<\/p>\n<p>\u6bd4\u5982\u6570\u636e\u5e93\u52a0\u5bc6\u540e&#xff0c;\u4e1a\u52a1\u4ee3\u7801\u67e5\u51fa\u6765\u7684\u5bf9\u8c61\u53ef\u80fd\u5df2\u7ecf\u662f\u660e\u6587\u3002\u5982\u679c\u63a5\u53e3\u76f4\u63a5\u8fd4\u56de&#xff0c;\u524d\u7aef\u4ecd\u7136\u80fd\u62ff\u5230\u5b8c\u6574\u8eab\u4efd\u8bc1\u53f7\u3002\u6240\u4ee5\u8fd8\u9700\u8981\u5728\u54cd\u5e94 DTO \u4e0a\u505a\u8131\u654f\u3002<\/p>\n<p>\u8fd9\u5757\u6211\u4e5f\u770b\u5230\u4e00\u4e9b\u53ef\u4ee5\u6539\u8fdb\u7684\u5730\u65b9&#xff1a;<\/p>\n<ul>\n<li>AES \u5bc6\u94a5\u4e0d\u5e94\u8be5\u76f4\u63a5\u5199\u5728 YAML \u91cc&#xff0c;\u751f\u4ea7\u73af\u5883\u5e94\u653e\u5230 KMS\u3001\u914d\u7f6e\u4e2d\u5fc3\u6216\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<li>\u7528\u6237\u670d\u52a1\u548c\u8ba2\u5355\u670d\u52a1\u91cc\u6709\u91cd\u590d\u7684\u8131\u654f\u5e8f\u5217\u5316\u5668&#xff0c;\u53ef\u4ee5\u62bd\u5230\u516c\u5171 starter\u3002<\/li>\n<li>\u90ae\u7bb1\u3001\u5730\u5740\u7b49\u5b57\u6bb5\u5982\u679c\u4f1a\u8fd4\u56de\u7ed9\u524d\u7aef&#xff0c;\u4e5f\u5e94\u8be5\u6709\u7edf\u4e00\u8131\u654f\u89c4\u5219\u3002<\/li>\n<\/ul>\n<p>\u5b66\u4e60\u8fd9\u90e8\u5206\u540e&#xff0c;\u6211\u5bf9\u201c\u5b89\u5168\u201d\u6709\u4e86\u66f4\u5177\u4f53\u7684\u7406\u89e3&#xff1a;\u5b89\u5168\u4e0d\u662f\u53ea\u9760\u4e00\u4e2a\u70b9&#xff0c;\u800c\u662f\u8981\u8986\u76d6\u5b58\u50a8\u3001\u4f20\u8f93\u3001\u5c55\u793a\u3001\u65e5\u5fd7\u7b49\u591a\u4e2a\u73af\u8282\u3002<\/p>\n<hr \/>\n<h3>\u5341\u4e8c\u3001\u6211\u5bf9\u8fd9\u4e2a\u9879\u76ee\u4e0d\u8db3\u4e4b\u5904\u7684\u7406\u89e3<\/h3>\n<p>\u5b66\u5b8c\u4e4b\u540e&#xff0c;\u6211\u89c9\u5f97\u8fd9\u4e2a\u9879\u76ee\u4f5c\u4e3a\u5b66\u4e60\u9879\u76ee\u5df2\u7ecf\u8986\u76d6\u4e86\u5f88\u591a\u6838\u5fc3\u95ee\u9898&#xff0c;\u4f46\u5982\u679c\u4ece\u751f\u4ea7\u7ea7\u7cfb\u7edf\u89d2\u5ea6\u770b&#xff0c;\u8fd8\u6709\u4e00\u4e9b\u53ef\u4ee5\u7ee7\u7eed\u4f18\u5316\u7684\u5730\u65b9\u3002<\/p>\n<h4>1. \u90e8\u5206\u914d\u7f6e\u66f4\u9002\u5408\u5916\u7f6e<\/h4>\n<p>\u6bd4\u5982 ShardingSphere Encrypt \u7684 AES \u5bc6\u94a5\u76f4\u63a5\u5199\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u751f\u4ea7\u73af\u5883\u4f1a\u6709\u98ce\u9669\u3002\u66f4\u5408\u7406\u7684\u65b9\u5f0f\u662f\u653e\u5230\u914d\u7f6e\u4e2d\u5fc3\u3001\u5bc6\u94a5\u7ba1\u7406\u7cfb\u7edf\u6216\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<h4>2. \u90e8\u5206\u80fd\u529b\u53ef\u4ee5\u8fdb\u4e00\u6b65\u7edf\u4e00\u5c01\u88c5<\/h4>\n<p>\u4f8b\u5982\u624b\u673a\u53f7\u3001\u8eab\u4efd\u8bc1\u8131\u654f\u5e8f\u5217\u5316\u5668\u5728\u7528\u6237\u670d\u52a1\u548c\u8ba2\u5355\u670d\u52a1\u91cc\u90fd\u6709\u5b9e\u73b0\u3002\u8fd9\u4e2a\u53ef\u4ee5\u62bd\u6210\u516c\u5171 starter&#xff0c;\u907f\u514d\u91cd\u590d\u3002<\/p>\n<h4>3. \u903b\u8f91\u51b7\u70ed\u5206\u79bb\u8fd8\u4e0d\u662f\u7269\u7406\u51b7\u70ed\u5206\u79bb<\/h4>\n<p>\u76ee\u524d\u8ba2\u5355\u51b7\u70ed\u5206\u79bb\u4f9d\u8d56 status \u5b57\u6bb5\u8fc7\u6ee4&#xff0c;\u672c\u8d28\u4e0a\u8fd8\u5728\u540c\u4e00\u7ec4\u8868\u91cc\u3002\u6570\u636e\u91cf\u7ee7\u7eed\u589e\u957f\u540e&#xff0c;\u53ef\u4ee5\u8003\u8651\u5386\u53f2\u8ba2\u5355\u5f52\u6863\u3001ES \u67e5\u8be2\u3001\u51b7\u70ed\u5e93\u62c6\u5206\u3002<\/p>\n<h4>4. Canal \u540c\u6b65\u5b58\u5728\u6700\u7ec8\u4e00\u81f4\u6027\u5ef6\u8fdf<\/h4>\n<p>Canal &#043; MQ \u66f4\u65b0 Redis \u662f\u5f02\u6b65\u94fe\u8def&#xff0c;\u6570\u636e\u5e93\u66f4\u65b0\u540e Redis \u4f1a\u6709\u77ed\u6682\u5ef6\u8fdf\u3002\u5bf9\u4e8e\u5f3a\u4e00\u81f4\u573a\u666f&#xff0c;\u8fd8\u9700\u8981\u4e1a\u52a1\u540c\u6b65\u66f4\u65b0\u6216\u8bfb\u6570\u636e\u5e93\u515c\u5e95\u3002<\/p>\n<h4>5. \u5206\u5e93\u5206\u8868\u540e\u590d\u6742\u67e5\u8be2\u6210\u672c\u4f1a\u4e0a\u5347<\/h4>\n<p>\u5206\u5e93\u5206\u8868\u53ef\u4ee5\u89e3\u51b3\u5355\u5e93\u5355\u8868\u538b\u529b&#xff0c;\u4f46\u4e5f\u4f1a\u5e26\u6765\u8de8\u5e93\u5206\u9875\u3001\u805a\u5408\u7edf\u8ba1\u3001\u5206\u7247\u952e\u7f3a\u5931\u5168\u8def\u7531\u7b49\u95ee\u9898\u3002\u540e\u7eed\u5982\u679c\u8981\u505a\u590d\u6742\u68c0\u7d22&#xff0c;\u53ef\u4ee5\u501f\u52a9 ES \u6216\u5bbd\u8868\u3002<\/p>\n<p>\u6211\u89c9\u5f97\u80fd\u770b\u5230\u8fd9\u4e9b\u4e0d\u8db3\u4e5f\u5f88\u91cd\u8981\u3002\u5b66\u4e60\u9879\u76ee\u4e0d\u662f\u53ea\u80cc\u5b83\u201c\u7528\u4e86\u4ec0\u4e48\u6280\u672f\u201d&#xff0c;\u8fd8\u8981\u77e5\u9053\u5b83\u4e3a\u4ec0\u4e48\u8fd9\u6837\u8bbe\u8ba1&#xff0c;\u4ee5\u53ca\u5b83\u8fd8\u6709\u4ec0\u4e48\u8fb9\u754c\u3002<\/p>\n<hr \/>\n<h3>\u5341\u4e09\u3001\u5982\u679c\u9762\u8bd5\u8ba9\u6211\u8bb2\u8fd9\u4e2a\u9879\u76ee&#xff0c;\u6211\u4f1a\u600e\u4e48\u7ec4\u7ec7<\/h3>\n<p>\u5b66\u5b8c\u4e4b\u540e&#xff0c;\u6211\u89c9\u5f97\u9762\u8bd5\u8bb2\u9879\u76ee\u4e0d\u80fd\u4e00\u4e0a\u6765\u5c31\u5806\u6280\u672f\u540d\u8bcd&#xff0c;\u800c\u662f\u8981\u56f4\u7ed5\u4e1a\u52a1\u4e3b\u7ebf\u8bb2\u3002<\/p>\n<p>\u6211\u4f1a\u8fd9\u6837\u7ec4\u7ec7&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b65&#xff0c;\u5148\u8bb2\u9879\u76ee\u80cc\u666f\u3002<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u6a21\u62df 12306 \u7684\u5206\u5e03\u5f0f\u7968\u52a1\u7cfb\u7edf&#xff0c;\u6838\u5fc3\u573a\u666f\u662f\u9ad8\u5e76\u53d1\u8d2d\u7968\u3002\u9879\u76ee\u62c6\u5206\u4e3a\u7528\u6237\u3001\u8f66\u7968\u3001\u8ba2\u5355\u3001\u652f\u4ed8\u3001\u805a\u5408\u3001\u7f51\u5173\u7b49\u670d\u52a1\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff0c;\u8bb2\u6838\u5fc3\u4e1a\u52a1\u94fe\u8def\u3002<\/p>\n<p>\u7528\u6237\u63d0\u4ea4\u8d2d\u7968\u8bf7\u6c42\u540e&#xff0c;\u7cfb\u7edf\u5148\u901a\u8fc7 Redis &#043; Lua \u4ee4\u724c\u6876\u505a\u4f59\u7968\u9884\u6263&#xff0c;\u518d\u8fdb\u884c\u5ea7\u4f4d\u9501\u5b9a\u548c\u8ba2\u5355\u521b\u5efa\u3002\u8ba2\u5355\u521b\u5efa\u6210\u529f\u540e\u53d1\u9001 RocketMQ \u5ef6\u8fdf\u6d88\u606f&#xff0c;\u5982\u679c\u7528\u6237\u8d85\u65f6\u672a\u652f\u4ed8&#xff0c;\u6d88\u8d39\u7aef\u4f1a\u5173\u95ed\u8ba2\u5355\u3001\u91ca\u653e\u5ea7\u4f4d\u5e76\u56de\u6eda\u4ee4\u724c\u6876\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65&#xff0c;\u8bb2\u9ad8\u5e76\u53d1\u4fdd\u969c\u3002<\/p>\n<p>\u9879\u76ee\u901a\u8fc7 Redis \u9884\u6263\u51cf\u964d\u4f4e\u6570\u636e\u5e93\u538b\u529b&#xff0c;\u901a\u8fc7 Lua \u4fdd\u8bc1\u6263\u51cf\u539f\u5b50\u6027&#xff0c;\u901a\u8fc7\u5206\u5e03\u5f0f\u9501\u63a7\u5236\u8ba2\u5355\u72b6\u6001\u5e76\u53d1\u4fee\u6539&#xff0c;\u901a\u8fc7\u5e42\u7b49\u6846\u67b6\u89e3\u51b3\u91cd\u590d\u8bf7\u6c42\u548c MQ \u91cd\u590d\u6d88\u8d39\u3002<\/p>\n<p>\u7b2c\u56db\u6b65&#xff0c;\u8bb2\u6570\u636e\u5c42\u8bbe\u8ba1\u3002<\/p>\n<p>\u7528\u6237\u548c\u8ba2\u5355\u670d\u52a1\u4f7f\u7528 ShardingSphere \u5206\u5e93\u5206\u8868\u3002\u8ba2\u5355\u8868\u6309 user_id &#043; order_sn \u590d\u5408\u5206\u7247&#xff0c;\u517c\u987e\u7528\u6237\u8ba2\u5355\u67e5\u8be2\u548c\u8ba2\u5355\u53f7\u67e5\u8be2\u3002\u7528\u6237\u670d\u52a1\u6309 username\u3001phone\u3001mail \u7b49\u4e1a\u52a1\u952e\u5206\u7247\u3002<\/p>\n<p>\u7b2c\u4e94\u6b65&#xff0c;\u8bb2\u7f13\u5b58\u4e00\u81f4\u6027\u3002<\/p>\n<p>\u9879\u76ee\u4f7f\u7528 Canal \u76d1\u542c MySQL binlog&#xff0c;\u518d\u901a\u8fc7 RocketMQ \u53d1\u9001\u53d8\u66f4\u4e8b\u4ef6&#xff0c;\u6d88\u8d39\u8005\u6839\u636e\u8868\u540d\u901a\u8fc7\u7b56\u7565\u6a21\u5f0f\u8def\u7531\u5230\u4e0d\u540c\u5904\u7406\u5668&#xff0c;\u6700\u7ec8\u66f4\u65b0 Redis \u7f13\u5b58\u3002<\/p>\n<p>\u7b2c\u516d\u6b65&#xff0c;\u8bb2\u5de5\u7a0b\u5316\u3002<\/p>\n<p>\u9879\u76ee\u5c01\u88c5\u4e86\u591a\u4e2a starter&#xff0c;\u6bd4\u5982\u7edf\u4e00\u5f02\u5e38\u5904\u7406\u3001\u5e42\u7b49\u3001\u65e5\u5fd7\u3001\u7f13\u5b58\u3001\u5206\u5e03\u5f0f ID\u3001\u7b56\u7565\u6a21\u5f0f\u7b49&#xff0c;\u628a\u901a\u7528\u80fd\u529b\u4ece\u4e1a\u52a1\u4ee3\u7801\u4e2d\u62bd\u79bb\u51fa\u6765\u3002<\/p>\n<p>\u6700\u540e\u4e3b\u52a8\u8865\u5145\u4e0d\u8db3\u3002<\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u91cc\u8ba2\u5355\u51b7\u70ed\u5206\u79bb\u662f\u903b\u8f91\u5206\u79bb&#xff0c;\u8fd8\u6ca1\u6709\u505a\u7269\u7406\u5f52\u6863&#xff1b;Canal \u540c\u6b65 Redis \u662f\u6700\u7ec8\u4e00\u81f4\u6027&#xff1b;AES \u5bc6\u94a5\u76f4\u63a5\u5199\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d&#xff0c;\u751f\u4ea7\u73af\u5883\u53ef\u4ee5\u8fdb\u4e00\u6b65\u4f18\u5316\u3002<\/p>\n<p>\u6211\u89c9\u5f97\u8fd9\u6837\u7684\u8868\u8fbe\u4f1a\u6bd4\u5355\u7eaf\u8bf4\u201c\u6211\u7528\u4e86 Redis\u3001RocketMQ\u3001ShardingSphere\u201d\u66f4\u6e05\u695a&#xff0c;\u56e0\u4e3a\u5b83\u80fd\u4f53\u73b0\u6211\u77e5\u9053\u6bcf\u4e2a\u6280\u672f\u70b9\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h3>\u5341\u56db\u3001\u5b66\u5b8c\u8fd9\u4e2a\u9879\u76ee\u540e&#xff0c;\u6211\u6700\u5927\u7684\u6536\u83b7<\/h3>\n<p>\u5982\u679c\u53ea\u7528\u4e00\u53e5\u8bdd\u603b\u7ed3\u6211\u7684\u6536\u83b7&#xff1a;<\/p>\n<p>\u9ad8\u5e76\u53d1\u7cfb\u7edf\u8bbe\u8ba1\u4e0d\u662f\u5806\u6280\u672f&#xff0c;\u800c\u662f\u56f4\u7ed5\u6838\u5fc3\u4e1a\u52a1\u94fe\u8def&#xff0c;\u628a\u6bcf\u4e2a\u6280\u672f\u653e\u5728\u5408\u9002\u7684\u4f4d\u7f6e\u89e3\u51b3\u5177\u4f53\u95ee\u9898\u3002<\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u8ba9\u6211\u5bf9\u5f88\u591a\u95ee\u9898\u6709\u4e86\u66f4\u5177\u4f53\u7684\u7406\u89e3\u3002<\/p>\n<p>\u6bd4\u5982&#xff1a;<\/p>\n<ul>\n<li>Redis \u4e0d\u662f\u7b80\u5355\u505a\u7f13\u5b58&#xff0c;\u4e5f\u53ef\u4ee5\u505a\u9884\u6263\u51cf\u3001\u4ee4\u724c\u6876\u3001\u5e42\u7b49\u952e\u3002<\/li>\n<li>Lua \u7684\u4ef7\u503c\u4e0d\u53ea\u662f\u811a\u672c&#xff0c;\u800c\u662f\u628a\u591a\u6b65 Redis \u64cd\u4f5c\u53d8\u6210\u539f\u5b50\u64cd\u4f5c\u3002<\/li>\n<li>MQ \u4e0d\u53ea\u662f\u5f02\u6b65\u901a\u77e5&#xff0c;\u4e5f\u53ef\u4ee5\u505a\u5ef6\u8fdf\u5173\u5355\u3001\u524a\u5cf0\u3001\u6700\u7ec8\u4e00\u81f4\u6027\u8865\u507f\u3002<\/li>\n<li>\u5e42\u7b49\u4e0d\u662f\u53ef\u6709\u53ef\u65e0&#xff0c;\u800c\u662f\u5206\u5e03\u5f0f\u7cfb\u7edf\u5fc5\u987b\u8003\u8651\u7684\u95ee\u9898\u3002<\/li>\n<li>\u5206\u5e93\u5206\u8868\u7684\u5173\u952e\u4e0d\u662f\u914d\u7f6e&#xff0c;\u800c\u662f\u5206\u7247\u952e\u662f\u5426\u8d34\u5408\u4e1a\u52a1\u67e5\u8be2\u3002<\/li>\n<li>\u7b56\u7565\u6a21\u5f0f\u4e0d\u662f\u4e3a\u4e86\u70ab\u8bbe\u8ba1\u6a21\u5f0f&#xff0c;\u800c\u662f\u4e3a\u4e86\u9694\u79bb\u53d8\u5316\u70b9\u3002<\/li>\n<li>\u5168\u5c40\u5f02\u5e38\u5904\u7406\u3001\u7edf\u4e00\u8fd4\u56de\u3001\u8131\u654f\u8fd9\u4e9b\u57fa\u7840\u80fd\u529b&#xff0c;\u51b3\u5b9a\u4e86\u9879\u76ee\u662f\u5426\u89c4\u8303\u3002<\/li>\n<\/ul>\n<p>\u5b66\u8fd9\u4e2a\u9879\u76ee\u7684\u8fc7\u7a0b&#xff0c;\u4e5f\u8ba9\u6211\u610f\u8bc6\u5230&#xff1a;\u770b\u6e90\u7801\u4e0d\u80fd\u53ea\u770b\u201c\u8fd9\u4e2a\u7c7b\u5e72\u4e86\u4ec0\u4e48\u201d&#xff0c;\u800c\u8981\u628a\u5b83\u653e\u56de\u4e1a\u52a1\u94fe\u8def\u91cc\u601d\u8003\u3002<\/p>\n<p>\u6bd4\u5982\u770b\u5230\u4ee4\u724c\u6876&#xff0c;\u5c31\u8981\u95ee&#xff1a;\u5b83\u5728\u8d2d\u7968\u94fe\u8def\u7684\u54ea\u4e2a\u4f4d\u7f6e&#xff1f;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u6263\u6570\u636e\u5e93&#xff1f;\u5931\u8d25\u540e\u600e\u4e48\u56de\u6eda&#xff1f;<\/p>\n<p>\u770b\u5230\u5ef6\u8fdf\u6d88\u606f&#xff0c;\u5c31\u8981\u95ee&#xff1a;\u6d88\u606f\u91cd\u590d\u600e\u4e48\u529e&#xff1f;\u8ba2\u5355\u5df2\u652f\u4ed8\u600e\u4e48\u529e&#xff1f;\u91ca\u653e\u5ea7\u4f4d\u5931\u8d25\u600e\u4e48\u529e&#xff1f;<\/p>\n<p>\u770b\u5230\u5206\u5e93\u5206\u8868&#xff0c;\u5c31\u8981\u95ee&#xff1a;\u6309\u4ec0\u4e48\u5b57\u6bb5\u5206&#xff1f;\u54ea\u4e9b\u67e5\u8be2\u80fd\u7cbe\u51c6\u8def\u7531&#xff1f;\u54ea\u4e9b\u67e5\u8be2\u4f1a\u5168\u8def\u7531&#xff1f;<\/p>\n<p>\u53ea\u6709\u5e26\u7740\u8fd9\u4e9b\u95ee\u9898\u770b\u6e90\u7801&#xff0c;\u624d\u80fd\u771f\u6b63\u628a\u9879\u76ee\u5b66\u900f\u3002<\/p>\n<hr \/>\n<h3>\u5341\u4e94\u3001\u540e\u7eed\u6211\u8fd8\u60f3\u7ee7\u7eed\u8865\u7684\u80fd\u529b<\/h3>\n<p>\u867d\u7136\u8fd9\u4e2a\u9879\u76ee\u5df2\u7ecf\u8986\u76d6\u4e86\u5f88\u591a\u5185\u5bb9&#xff0c;\u4f46\u6211\u89c9\u5f97\u540e\u7eed\u8fd8\u53ef\u4ee5\u7ee7\u7eed\u8865\u51e0\u5757\u80fd\u529b&#xff1a;<\/p>\n<h4>1. \u538b\u6d4b\u548c\u6027\u80fd\u5206\u6790<\/h4>\n<p>\u9879\u76ee\u91cc\u6709\u5f88\u591a\u9ad8\u5e76\u53d1\u8bbe\u8ba1&#xff0c;\u4f46\u5982\u679c\u80fd\u914d\u5408 JMeter\u3001Arthas\u3001Prometheus \u8fd9\u7c7b\u5de5\u5177\u505a\u538b\u6d4b\u548c\u6307\u6807\u89c2\u5bdf&#xff0c;\u4f1a\u66f4\u5b8c\u6574\u3002<\/p>\n<p>\u6211\u5e0c\u671b\u540e\u7eed\u80fd\u8865\u5145&#xff1a;<\/p>\n<ul>\n<li>\u8d2d\u7968\u63a5\u53e3 QPS \u538b\u6d4b<\/li>\n<li>Redis \u548c MySQL \u538b\u529b\u5bf9\u6bd4<\/li>\n<li>Lua \u811a\u672c\u6267\u884c\u8017\u65f6<\/li>\n<li>RocketMQ \u6d88\u8d39\u5806\u79ef\u89c2\u5bdf<\/li>\n<li>\u5206\u5e93\u5206\u8868\u524d\u540e\u67e5\u8be2\u6027\u80fd\u5bf9\u6bd4<\/li>\n<\/ul>\n<h4>2. \u66f4\u6df1\u5165\u7684\u4e8b\u52a1\u4e00\u81f4\u6027<\/h4>\n<p>\u9879\u76ee\u4e2d\u7528\u4e86 MQ\u3001Canal\u3001\u5e42\u7b49\u3001\u8865\u507f\u7b49\u65b9\u5f0f\u4fdd\u8bc1\u6700\u7ec8\u4e00\u81f4\u6027&#xff0c;\u4f46\u5982\u679c\u7ee7\u7eed\u6df1\u5165&#xff0c;\u53ef\u4ee5\u5b66\u4e60&#xff1a;<\/p>\n<ul>\n<li>\u672c\u5730\u6d88\u606f\u8868<\/li>\n<li>\u4e8b\u52a1\u6d88\u606f<\/li>\n<li>TCC<\/li>\n<li>Saga<\/li>\n<li>\u6700\u5927\u52aa\u529b\u901a\u77e5<\/li>\n<\/ul>\n<p>\u8fd9\u6837\u5bf9\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u7406\u89e3\u4f1a\u66f4\u5b8c\u6574\u3002<\/p>\n<h4>3. \u66f4\u5b8c\u6574\u7684\u751f\u4ea7\u7ea7\u5b89\u5168\u8bbe\u8ba1<\/h4>\n<p>\u654f\u611f\u6570\u636e\u4fdd\u62a4\u53ef\u4ee5\u7ee7\u7eed\u6269\u5c55&#xff1a;<\/p>\n<ul>\n<li>\u5bc6\u94a5\u6258\u7ba1<\/li>\n<li>\u65e5\u5fd7\u8131\u654f<\/li>\n<li>\u63a5\u53e3\u6743\u9650\u63a7\u5236<\/li>\n<li>\u6570\u636e\u8bbf\u95ee\u5ba1\u8ba1<\/li>\n<li>\u9632\u6b62\u8d8a\u6743\u67e5\u8be2<\/li>\n<\/ul>\n<h4>4. \u670d\u52a1\u6cbb\u7406\u548c\u53ef\u89c2\u6d4b\u6027<\/h4>\n<p>\u9879\u76ee\u91cc\u53ef\u4ee5\u7ee7\u7eed\u8865\u5145&#xff1a;<\/p>\n<ul>\n<li>Sentinel \u9650\u6d41\u7194\u65ad<\/li>\n<li>SkyWalking \u94fe\u8def\u8ffd\u8e2a<\/li>\n<li>Prometheus &#043; Grafana \u6307\u6807\u76d1\u63a7<\/li>\n<li>ELK \u65e5\u5fd7\u68c0\u7d22<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u80fd\u529b\u80fd\u8ba9\u9879\u76ee\u66f4\u63a5\u8fd1\u771f\u5b9e\u751f\u4ea7\u73af\u5883\u3002<\/p>\n<hr \/>\n<h3>\u5341\u516d\u3001\u6211\u7ed9\u81ea\u5df1\u6574\u7406\u7684\u6e90\u7801\u590d\u4e60\u7d22\u5f15<\/h3>\n<p>\u5b66\u5b8c\u6574\u4e2a\u9879\u76ee\u540e&#xff0c;\u6211\u89c9\u5f97\u540e\u9762\u590d\u4e60\u4e0d\u80fd\u518d\u4ece\u5934\u5230\u5c3e\u7ffb\u6240\u6709\u4ee3\u7801&#xff0c;\u800c\u662f\u5e94\u8be5\u6309\u80fd\u529b\u6a21\u5757\u590d\u4e60\u3002\u4e0b\u9762\u662f\u6211\u7ed9\u81ea\u5df1\u6574\u7406\u7684\u6e90\u7801\u7d22\u5f15\u3002<\/p>\n<h4>1. \u9ad8\u5e76\u53d1\u8d2d\u7968\u4e3b\u94fe\u8def<\/h4>\n<p>services\/ticket-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/ticketservice\/service\/handler\/ticket\/tokenbucket\/TicketAvailabilityTokenBucket.java<br \/>\nservices\/ticket-service\/src\/main\/resources\/lua\/ticket_availability_token_bucket.lua<br \/>\nservices\/ticket-service\/src\/main\/resources\/lua\/ticket_availability_rollback_token_bucket.lua<br \/>\nservices\/ticket-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/ticketservice\/mq\/consumer\/DelayCloseOrderConsumer.java<br \/>\nservices\/order-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/orderservice\/service\/impl\/OrderServiceImpl.java<\/p>\n<p>\u590d\u4e60\u91cd\u70b9&#xff1a;\u8d2d\u7968\u8bf7\u6c42\u4e3a\u4ec0\u4e48\u5148\u7ecf\u8fc7\u4ee4\u724c\u6876&#xff0c;Redis Hash \u5982\u4f55\u7ec4\u7ec7\u533a\u95f4\u4f59\u7968&#xff0c;Lua \u5982\u4f55\u4fdd\u8bc1\u5224\u65ad\u548c\u6263\u51cf\u539f\u5b50\u6027&#xff0c;\u8ba2\u5355\u5173\u95ed\u540e\u5ea7\u4f4d\u3001\u7f13\u5b58\u3001\u4ee4\u724c\u6876\u5982\u4f55\u56de\u6eda\u3002<\/p>\n<h4>2. \u5e42\u7b49\u6846\u67b6<\/h4>\n<p>frameworks\/idempotent\/src\/main\/java\/org\/opengoofy\/index12306\/framework\/starter\/idempotent\/annotation\/Idempotent.java<br \/>\nframeworks\/idempotent\/src\/main\/java\/org\/opengoofy\/index12306\/framework\/starter\/idempotent\/aop\/IdempotentAspect.java<br \/>\nframeworks\/idempotent\/src\/main\/java\/org\/opengoofy\/index12306\/framework\/starter\/idempotent\/core\/IdempotentExecuteHandler.java<br \/>\nframeworks\/idempotent\/src\/main\/resources\/lua\/set_if_absent_and_get.lua<\/p>\n<p>\u590d\u4e60\u91cd\u70b9&#xff1a;&#064;Idempotent \u6ce8\u89e3\u6807\u8bb0\u4e86\u54ea\u4e9b\u4fe1\u606f&#xff0c;AOP \u5728\u4ec0\u4e48\u65f6\u5019\u62e6\u622a\u4e1a\u52a1\u65b9\u6cd5&#xff0c;PARAM\u3001TOKEN\u3001SPEL \u4e09\u79cd\u6a21\u5f0f\u5206\u522b\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898&#xff0c;Redis \u5e42\u7b49 key \u5982\u4f55\u751f\u6210\u3002<\/p>\n<h4>3. \u7b56\u7565\u6a21\u5f0f\u4e0e Canal \u8def\u7531<\/h4>\n<p>frameworks\/designpattern\/src\/main\/java\/org\/opengoofy\/index12306\/framework\/starter\/designpattern\/strategy\/AbstractExecuteStrategy.java<br \/>\nframeworks\/designpattern\/src\/main\/java\/org\/opengoofy\/index12306\/framework\/starter\/designpattern\/strategy\/AbstractStrategyChoose.java<br \/>\nservices\/ticket-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/ticketservice\/mq\/consumer\/CanalCommonSyncBinlogConsumer.java<br \/>\nservices\/ticket-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/ticketservice\/canal\/TicketAvailabilityCacheUpdateHandler.java<br \/>\nservices\/ticket-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/ticketservice\/canal\/OrderCloseCacheAndTokenUpdateHandler.java<\/p>\n<p>\u590d\u4e60\u91cd\u70b9&#xff1a;\u7b56\u7565\u5904\u7406\u5668\u5982\u4f55\u901a\u8fc7 mark() \u66b4\u9732\u81ea\u5df1\u7684\u6807\u8bc6&#xff0c;Spring \u5bb9\u5668\u542f\u52a8\u540e\u5982\u4f55\u6536\u96c6\u6240\u6709\u7b56\u7565 Bean&#xff0c;Canal \u6d88\u8d39\u8005\u4e3a\u4ec0\u4e48\u4e0d\u7528\u5927\u91cf if-else\u3002<\/p>\n<h4>4. \u5206\u5e93\u5206\u8868\u4e0e\u5de5\u7a0b\u5316\u57fa\u7840\u80fd\u529b<\/h4>\n<p>services\/order-service\/src\/main\/resources\/shardingsphere-config.yaml<br \/>\nservices\/user-service\/src\/main\/resources\/shardingsphere-config.yaml<br \/>\nservices\/order-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/orderservice\/dao\/algorithm\/OrderCommonDataBaseComplexAlgorithm.java<br \/>\nservices\/order-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/orderservice\/dao\/algorithm\/OrderCommonTableComplexAlgorithm.java<br \/>\nframeworks\/web\/src\/main\/java\/org\/opengoofy\/index12306\/framework\/starter\/web\/GlobalExceptionHandler.java<br \/>\nframeworks\/web\/src\/main\/java\/org\/opengoofy\/index12306\/framework\/starter\/web\/Results.java<br \/>\nservices\/user-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/userservice\/serialize\/PhoneDesensitizationSerializer.java<br \/>\nservices\/user-service\/src\/main\/java\/org\/opengoofy\/index12306\/biz\/userservice\/serialize\/IdCardDesensitizationSerializer.java<\/p>\n<p>\u590d\u4e60\u91cd\u70b9&#xff1a;\u8ba2\u5355\u8868\u4e3a\u4ec0\u4e48\u7528 user_id &#043; order_sn \u590d\u5408\u5206\u7247&#xff0c;\u7528\u6237\u670d\u52a1\u4e3a\u4ec0\u4e48\u6309\u591a\u4e2a\u4e1a\u52a1\u952e\u5206\u7247&#xff0c;\u5168\u5c40\u5f02\u5e38\u5982\u4f55\u7edf\u4e00\u9519\u8bef\u51fa\u53e3&#xff0c;\u5b58\u50a8\u52a0\u5bc6\u548c\u63a5\u53e3\u8131\u654f\u5206\u522b\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h3>\u5341\u4e03\u3001\u6211\u7ed9\u81ea\u5df1\u6574\u7406\u7684\u590d\u4e60\u8def\u7ebf<\/h3>\n<p>\u5982\u679c\u540e\u9762\u91cd\u65b0\u590d\u4e60\u8fd9\u4e2a\u9879\u76ee&#xff0c;\u6211\u4e0d\u4f1a\u518d\u6309\u6a21\u5757\u4ece\u5934\u770b&#xff0c;\u800c\u662f\u6309\u8fd9\u6761\u8def\u7ebf\u590d\u4e60&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u8f6e&#xff1a;\u5148\u770b\u4e1a\u52a1\u94fe\u8def<br \/>\n\u8d2d\u7968\u8bf7\u6c42 -&gt; \u4ee4\u724c\u6876 -&gt; \u5ea7\u4f4d\u9501\u5b9a -&gt; \u521b\u5efa\u8ba2\u5355 -&gt; \u5ef6\u8fdf\u5173\u5355 -&gt; \u56de\u6eda\u5e93\u5b58<\/p>\n<p>\u7b2c\u4e8c\u8f6e&#xff1a;\u518d\u770b\u9ad8\u5e76\u53d1\u4fdd\u969c<br \/>\nRedis Lua -&gt; \u5e42\u7b49 -&gt; \u5206\u5e03\u5f0f\u9501 -&gt; MQ \u5ef6\u8fdf\u8865\u507f<\/p>\n<p>\u7b2c\u4e09\u8f6e&#xff1a;\u770b\u6570\u636e\u5c42\u8bbe\u8ba1<br \/>\n\u5206\u5e93\u5206\u8868 -&gt; \u51b7\u70ed\u5206\u79bb -&gt; \u96ea\u82b1 ID -&gt; \u654f\u611f\u5b57\u6bb5\u52a0\u5bc6<\/p>\n<p>\u7b2c\u56db\u8f6e&#xff1a;\u770b\u5de5\u7a0b\u5316\u5c01\u88c5<br \/>\n\u5168\u5c40\u5f02\u5e38 -&gt; \u7edf\u4e00\u8fd4\u56de -&gt; \u7b56\u7565\u6a21\u5f0f -&gt; starter \u62bd\u8c61<\/p>\n<p>\u7b2c\u4e94\u8f6e&#xff1a;\u770b\u4e00\u81f4\u6027\u548c\u8865\u507f<br \/>\nCanal -&gt; RocketMQ -&gt; Redis \u540c\u6b65 -&gt; \u91cd\u590d\u6d88\u8d39 -&gt; \u6700\u7ec8\u4e00\u81f4\u6027<\/p>\n<p>\u8fd9\u6761\u8def\u7ebf\u7684\u597d\u5904\u662f&#xff0c;\u5b83\u4e0d\u662f\u6309\u6587\u4ef6\u5939\u5b66\u4e60&#xff0c;\u800c\u662f\u6309\u7cfb\u7edf\u95ee\u9898\u5b66\u4e60\u3002\u8fd9\u6837\u66f4\u5bb9\u6613\u628a\u6e90\u7801\u548c\u4e1a\u52a1\u573a\u666f\u5bf9\u5e94\u8d77\u6765\u3002<\/p>\n<hr \/>\n<h3>\u5341\u516b\u3001\u6211\u6700\u540e\u5f62\u6210\u7684\u4e00\u5f20\u7cfb\u7edf\u8bbe\u8ba1\u8111\u56fe<\/h3>\n<p>\u6700\u540e&#xff0c;\u6211\u628a\u8fd9\u4e2a\u9879\u76ee\u6309\u7cfb\u7edf\u80fd\u529b\u6574\u7406\u6210\u4e00\u5f20\u6587\u5b57\u7248\u8111\u56fe&#xff1a;<\/p>\n<p>12306 \u5206\u5e03\u5f0f\u7968\u52a1\u7cfb\u7edf<br \/>\n|<br \/>\n|&#8211; \u4e1a\u52a1\u4e3b\u7ebf<br \/>\n|   |&#8211; \u7528\u6237\u6ce8\u518c\u767b\u5f55<br \/>\n|   |&#8211; \u8f66\u6b21\u548c\u4f59\u7968\u67e5\u8be2<br \/>\n|   |&#8211; \u8d2d\u7968\u4e0b\u5355<br \/>\n|   |&#8211; \u652f\u4ed8\u56de\u8c03<br \/>\n|   |&#8211; \u8ba2\u5355\u5173\u95ed<br \/>\n|   &#096;&#8211; \u8ba2\u5355\u67e5\u8be2<br \/>\n|<br \/>\n|&#8211; \u9ad8\u5e76\u53d1\u80fd\u529b<br \/>\n|   |&#8211; Redis \u4f59\u7968\u7f13\u5b58<br \/>\n|   |&#8211; Redis Hash \u4ee4\u724c\u6876<br \/>\n|   |&#8211; Lua \u539f\u5b50\u6263\u51cf<br \/>\n|   |&#8211; Redisson \u5206\u5e03\u5f0f\u9501<br \/>\n|   &#096;&#8211; MQ \u524a\u5cf0\u548c\u5ef6\u8fdf\u8865\u507f<br \/>\n|<br \/>\n|&#8211; \u4e00\u81f4\u6027\u80fd\u529b<br \/>\n|   |&#8211; MQ \u5ef6\u8fdf\u5173\u5355<br \/>\n|   |&#8211; \u5e42\u7b49\u6846\u67b6\u9632\u91cd\u590d\u6d88\u8d39<br \/>\n|   |&#8211; Canal \u76d1\u542c binlog<br \/>\n|   |&#8211; Redis \u7f13\u5b58\u6700\u7ec8\u4e00\u81f4\u6027<br \/>\n|   &#096;&#8211; \u8ba2\u5355\u72b6\u6001\u6821\u9a8c\u515c\u5e95<br \/>\n|<br \/>\n|&#8211; \u6570\u636e\u5c42\u80fd\u529b<br \/>\n|   |&#8211; ShardingSphere \u5206\u5e93\u5206\u8868<br \/>\n|   |&#8211; \u7528\u6237\u8868\u591a\u4e1a\u52a1\u952e\u5206\u7247<br \/>\n|   |&#8211; \u8ba2\u5355\u8868\u590d\u5408\u5206\u7247<br \/>\n|   |&#8211; \u96ea\u82b1\u7b97\u6cd5\u751f\u6210\u5206\u5e03\u5f0f ID<br \/>\n|   &#096;&#8211; \u903b\u8f91\u51b7\u70ed\u5206\u79bb<br \/>\n|<br \/>\n|&#8211; \u5de5\u7a0b\u5316\u80fd\u529b<br \/>\n|   |&#8211; starter \u5c01\u88c5<br \/>\n|   |&#8211; \u5168\u5c40\u5f02\u5e38\u5904\u7406<br \/>\n|   |&#8211; \u7edf\u4e00\u8fd4\u56de\u7ed3\u679c<br \/>\n|   |&#8211; \u7b56\u7565\u6a21\u5f0f\u8def\u7531<br \/>\n|   |&#8211; \u8d23\u4efb\u94fe\u6a21\u5f0f\u6269\u5c55<br \/>\n|   &#096;&#8211; \u65e5\u5fd7\u4e0e\u64cd\u4f5c\u8bb0\u5f55<br \/>\n|<br \/>\n&#096;&#8211; \u5b89\u5168\u80fd\u529b<br \/>\n    |&#8211; ShardingSphere Encrypt \u5b58\u50a8\u52a0\u5bc6<br \/>\n    |&#8211; Jackson \u5e8f\u5217\u5316\u8131\u654f<br \/>\n    |&#8211; \u624b\u673a\u53f7\u8131\u654f<br \/>\n    |&#8211; \u8eab\u4efd\u8bc1\u53f7\u8131\u654f<br \/>\n    &#096;&#8211; \u7edf\u4e00\u5f02\u5e38\u907f\u514d\u5185\u90e8\u4fe1\u606f\u6cc4\u9732<\/p>\n<p>\u8fd9\u5f20\u56fe\u4e5f\u662f\u6211\u540e\u9762\u590d\u4e60\u8fd9\u4e2a\u9879\u76ee\u65f6\u6700\u91cd\u8981\u7684\u603b\u89c8\u3002\u53ea\u8981\u8fd9\u5f20\u56fe\u80fd\u8bb2\u6e05\u695a&#xff0c;\u8bf4\u660e\u6211\u5bf9\u9879\u76ee\u7684\u6574\u4f53\u7406\u89e3\u5c31\u4e0d\u4f1a\u6563\u3002<\/p>\n<hr \/>\n<h3>\u7ed3\u5c3e<\/h3>\n<p>\u8fd9\u6b21\u5b66\u4e60 12306 \u9879\u76ee&#xff0c;\u5bf9\u6211\u6700\u5927\u7684\u5e2e\u52a9\u4e0d\u662f\u8bb0\u4f4f\u67d0\u4e2a\u6846\u67b6\u7684 API&#xff0c;\u800c\u662f\u8ba9\u6211\u5f00\u59cb\u4ece\u7cfb\u7edf\u89d2\u5ea6\u601d\u8003\u95ee\u9898\u3002<\/p>\n<p>\u4ee5\u524d\u770b\u5230\u4e00\u4e2a\u6280\u672f\u70b9&#xff0c;\u6211\u53ef\u80fd\u53ea\u4f1a\u95ee\u201c\u5b83\u600e\u4e48\u7528\u201d\u3002<\/p>\n<p>\u73b0\u5728\u6211\u66f4\u4f1a\u95ee&#xff1a;<\/p>\n<ul>\n<li>\u5b83\u89e3\u51b3\u4e86\u54ea\u4e2a\u4e1a\u52a1\u95ee\u9898&#xff1f;<\/li>\n<li>\u5b83\u5728\u94fe\u8def\u7684\u54ea\u4e2a\u4f4d\u7f6e&#xff1f;<\/li>\n<li>\u5b83\u5931\u8d25\u540e\u6709\u6ca1\u6709\u515c\u5e95&#xff1f;<\/li>\n<li>\u5b83\u548c\u5176\u4ed6\u7ec4\u4ef6\u600e\u4e48\u914d\u5408&#xff1f;<\/li>\n<li>\u5b83\u6709\u4ec0\u4e48\u8fb9\u754c\u548c\u4e0d\u8db3&#xff1f;<\/li>\n<\/ul>\n<p>\u6211\u89c9\u5f97\u8fd9\u624d\u662f\u5b66\u4e60\u9879\u76ee\u6700\u91cd\u8981\u7684\u6536\u83b7\u3002<\/p>\n<p>\u9879\u76ee\u6e90\u7801\u53ea\u662f\u8d77\u70b9&#xff0c;\u771f\u6b63\u6709\u4ef7\u503c\u7684\u662f\u901a\u8fc7\u6e90\u7801\u628a\u4e1a\u52a1\u3001\u67b6\u6784\u3001\u5de5\u7a0b\u5316\u548c\u9762\u8bd5\u8868\u8fbe\u4e32\u8d77\u6765\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u5b8c 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u540e&#xff0c;\u6211\u5bf9\u9ad8\u5e76\u53d1\u7cfb\u7edf\u8bbe\u8ba1\u7684\u6574\u4f53\u7406\u89e3<br \/>\n\u524d\u6bb5\u65f6\u95f4\u6211\u7cfb\u7edf\u5b66\u4e60\u4e86\u4e00\u4e2a 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u3002\u521a\u5f00\u59cb\u770b\u8fd9\u4e2a\u9879\u76ee\u65f6&#xff0c;\u6211\u66f4\u591a\u5173\u6ce8\u7684\u662f\u201c\u7528\u4e86\u54ea\u4e9b\u6280\u672f\u201d&#xff1a;Redis\u3001RocketMQ\u3001ShardingSphere\u3001Canal\u3001Redisson\u3001Sentinel\u3001Spring Boot Starter \u7b49\u3002<br \/>\n\u4f46\u771f\u6b63\u628a\u6e90\u7801\u3001\u4e1a\u52a1\u94fe\u8def\u548c\u9762\u8bd5\u95ee\u9898\u4e32\u8d77\u6765\u4e4b\u540e&#xff0c;\u6211\u53d1\u73b0\u8fd9\u4e2a\u9879\u76ee\u6700\u503c\u5f97\u5b66\u4e60\u7684\u5730\u65b9\u5e76\u4e0d\u662f\u67d0\u4e00\u4e2a\u5355\u72ec\u6280\u672f\u70b9&amp;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,114,3294,98,398],"topic":[],"class_list":["post-87765","post","type-post","status-publish","format-standard","hentry","category-server","tag-java","tag-mysql","tag-rocketmq","tag-spring-boot","tag-398"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>12306\u9879\u76ee\u5b66\u4e60day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/87765.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"12306\u9879\u76ee\u5b66\u4e60day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5b66\u5b8c 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u540e&#xff0c;\u6211\u5bf9\u9ad8\u5e76\u53d1\u7cfb\u7edf\u8bbe\u8ba1\u7684\u6574\u4f53\u7406\u89e3 \u524d\u6bb5\u65f6\u95f4\u6211\u7cfb\u7edf\u5b66\u4e60\u4e86\u4e00\u4e2a 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u3002\u521a\u5f00\u59cb\u770b\u8fd9\u4e2a\u9879\u76ee\u65f6&#xff0c;\u6211\u66f4\u591a\u5173\u6ce8\u7684\u662f\u201c\u7528\u4e86\u54ea\u4e9b\u6280\u672f\u201d&#xff1a;Redis\u3001RocketMQ\u3001ShardingSphere\u3001Canal\u3001Redisson\u3001Sentinel\u3001Spring Boot Starter \u7b49\u3002 \u4f46\u771f\u6b63\u628a\u6e90\u7801\u3001\u4e1a\u52a1\u94fe\u8def\u548c\u9762\u8bd5\u95ee\u9898\u4e32\u8d77\u6765\u4e4b\u540e&#xff0c;\u6211\u53d1\u73b0\u8fd9\u4e2a\u9879\u76ee\u6700\u503c\u5f97\u5b66\u4e60\u7684\u5730\u65b9\u5e76\u4e0d\u662f\u67d0\u4e00\u4e2a\u5355\u72ec\u6280\u672f\u70b9&amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/87765.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-30T13:08:58+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87765.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/87765.html\",\"name\":\"12306\u9879\u76ee\u5b66\u4e60day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-30T13:08:58+00:00\",\"dateModified\":\"2026-07-30T13:08:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/87765.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/87765.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87765.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"12306\u9879\u76ee\u5b66\u4e60day6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"12306\u9879\u76ee\u5b66\u4e60day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/87765.html","og_locale":"zh_CN","og_type":"article","og_title":"12306\u9879\u76ee\u5b66\u4e60day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5b66\u5b8c 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u540e&#xff0c;\u6211\u5bf9\u9ad8\u5e76\u53d1\u7cfb\u7edf\u8bbe\u8ba1\u7684\u6574\u4f53\u7406\u89e3 \u524d\u6bb5\u65f6\u95f4\u6211\u7cfb\u7edf\u5b66\u4e60\u4e86\u4e00\u4e2a 12306 \u5206\u5e03\u5f0f\u7968\u52a1\u9879\u76ee\u3002\u521a\u5f00\u59cb\u770b\u8fd9\u4e2a\u9879\u76ee\u65f6&#xff0c;\u6211\u66f4\u591a\u5173\u6ce8\u7684\u662f\u201c\u7528\u4e86\u54ea\u4e9b\u6280\u672f\u201d&#xff1a;Redis\u3001RocketMQ\u3001ShardingSphere\u3001Canal\u3001Redisson\u3001Sentinel\u3001Spring Boot Starter \u7b49\u3002 \u4f46\u771f\u6b63\u628a\u6e90\u7801\u3001\u4e1a\u52a1\u94fe\u8def\u548c\u9762\u8bd5\u95ee\u9898\u4e32\u8d77\u6765\u4e4b\u540e&#xff0c;\u6211\u53d1\u73b0\u8fd9\u4e2a\u9879\u76ee\u6700\u503c\u5f97\u5b66\u4e60\u7684\u5730\u65b9\u5e76\u4e0d\u662f\u67d0\u4e00\u4e2a\u5355\u72ec\u6280\u672f\u70b9&amp;","og_url":"https:\/\/www.wsisp.com\/helps\/87765.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-30T13:08:58+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/87765.html","url":"https:\/\/www.wsisp.com\/helps\/87765.html","name":"12306\u9879\u76ee\u5b66\u4e60day6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-30T13:08:58+00:00","dateModified":"2026-07-30T13:08:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/87765.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/87765.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/87765.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"12306\u9879\u76ee\u5b66\u4e60day6"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=87765"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87765\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=87765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=87765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=87765"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=87765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}