Skip to content

Commit

Permalink
route
Browse files Browse the repository at this point in the history
  • Loading branch information
Ye-Yu-Mo committed Oct 8, 2024
1 parent 8d5017b commit 908cafe
Show file tree
Hide file tree
Showing 166 changed files with 2,966 additions and 831 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ ProducerClient和ConsumerClient通过网络的方式远程调用这些API实现
* Fanout-广播交换: 复制发布到该交换机的所有队列
* Topic-主题交换: 队列在创建时指定了一个bindingKey, 当交换机收到一个消息时, 该消息内部存在一个字符串routingKey, 当routingKey与bindKey满足一定条件时, 把消息存到该队列中

> 匹配样例
binding_key: news.music.# 约定字符: 数字\\字母\\ '\_' \\ '\.' \\ '\#' \\ '\*'
routing_key: news.music.pop 约定字符: 数字\\字母\\ '\_' \\ '\.'
> 匹配规则<br> <br>
binding_key: `news.music.#` 约定字符: 数字`0~9`\\字母`a~z A~Z`\\ `_` \\ `.` \\ `#` \\ `*`<br> **注意** <br> 1. `*` 通配符可以代替一个任意单词 例如: `news.*.footable`是合法的<br> 2. `#` 通配符可以代替任意多个(0个或任意个)单词 例如: `news.sport.#`是合法的<br> 3. 在两个点直接不允许出现通配符和其他字符 例如: `news.*a.footable`是不合法的<br> 4. `#`通配符不允许连续使用通配符 没有意义 例如`news.#.*.footable #.# *.# #.*`是不合法的<br> <br> routing_key: news.music.pop 约定字符: 数字`0~9`\\字母`a~z A~Z`\\ `_` \\ `.`
### 网络通信

Expand Down
28 changes: 15 additions & 13 deletions docs/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,21 @@
<tr id="row_0_17_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_msg_queue_manager.html" target="_self">MsgQueueManager</a></td><td class="desc">消息队列数据内存管理类 </td></tr>
<tr id="row_0_18_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_msg_queue_mapper.html" target="_self">MsgQueueMapper</a></td><td class="desc">消息队列持久化管理类 将数据存储在sqlite数据库中 </td></tr>
<tr id="row_0_19_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_queue_message.html" target="_self">QueueMessage</a></td><td class="desc">推送消息队列管理 </td></tr>
<tr id="row_0_20_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_sqlite_helper.html" target="_self">SqliteHelper</a></td><td class="desc">SQLite 数据库操作助手类 </td></tr>
<tr id="row_0_21_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_str_helper.html" target="_self">StrHelper</a></td><td class="desc">字符串处理助手类 </td></tr>
<tr id="row_0_22_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_u_u_i_d_helper.html" target="_self">UUIDHelper</a></td><td class="desc">提供生成 UUID 的工具类。 </td></tr>
<tr id="row_0_23_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_virtual_host.html" target="_self">VirtualHost</a></td><td class="desc">虚拟机模块 </td></tr>
<tr id="row_1_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_binding_test.html" target="_self">BindingTest</a></td><td class="desc"></td></tr>
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_exchanger_mapper.html" target="_self">ExchangerMapper</a></td><td class="desc">交换机持久化管理类 将数据存储在sqlite数据库中 </td></tr>
<tr id="row_3_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_exchange_test.html" target="_self">ExchangeTest</a></td><td class="desc"></td></tr>
<tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_host_test.html" target="_self">HostTest</a></td><td class="desc"></td></tr>
<tr id="row_5_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__proto__enum_3_01_1_1_xu_m_q_1_1_delivery_mode_01_4.html" target="_self">is_proto_enum&lt; ::XuMQ::DeliveryMode &gt;</a></td><td class="desc"></td></tr>
<tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__proto__enum_3_01_1_1_xu_m_q_1_1_exchange_type_01_4.html" target="_self">is_proto_enum&lt; ::XuMQ::ExchangeType &gt;</a></td><td class="desc"></td></tr>
<tr id="row_7_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_queue_test.html" target="_self">QueueTest</a></td><td class="desc"></td></tr>
<tr id="row_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_table_struct__msg__2eproto.html" target="_self">TableStruct_msg_2eproto</a></td><td class="desc"></td></tr>
<tr id="row_9_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_u_u_i_d_helper.html" target="_self">UUIDHelper</a></td><td class="desc"></td></tr>
<tr id="row_0_20_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_router.html" target="_self">Router</a></td><td class="desc">路由管理器 </td></tr>
<tr id="row_0_21_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_sqlite_helper.html" target="_self">SqliteHelper</a></td><td class="desc">SQLite 数据库操作助手类 </td></tr>
<tr id="row_0_22_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_str_helper.html" target="_self">StrHelper</a></td><td class="desc">字符串处理助手类 </td></tr>
<tr id="row_0_23_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_u_u_i_d_helper.html" target="_self">UUIDHelper</a></td><td class="desc">提供生成 UUID 的工具类。 </td></tr>
<tr id="row_0_24_" class="odd"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_xu_m_q_1_1_virtual_host.html" target="_self">VirtualHost</a></td><td class="desc">虚拟机模块 </td></tr>
<tr id="row_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_binding_test.html" target="_self">BindingTest</a></td><td class="desc"></td></tr>
<tr id="row_2_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_exchanger_mapper.html" target="_self">ExchangerMapper</a></td><td class="desc">交换机持久化管理类 将数据存储在sqlite数据库中 </td></tr>
<tr id="row_3_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_exchange_test.html" target="_self">ExchangeTest</a></td><td class="desc"></td></tr>
<tr id="row_4_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_host_test.html" target="_self">HostTest</a></td><td class="desc"></td></tr>
<tr id="row_5_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__proto__enum_3_01_1_1_xu_m_q_1_1_delivery_mode_01_4.html" target="_self">is_proto_enum&lt; ::XuMQ::DeliveryMode &gt;</a></td><td class="desc"></td></tr>
<tr id="row_6_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structis__proto__enum_3_01_1_1_xu_m_q_1_1_exchange_type_01_4.html" target="_self">is_proto_enum&lt; ::XuMQ::ExchangeType &gt;</a></td><td class="desc"></td></tr>
<tr id="row_7_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_queue_test.html" target="_self">QueueTest</a></td><td class="desc"></td></tr>
<tr id="row_8_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_route_test.html" target="_self">RouteTest</a></td><td class="desc"></td></tr>
<tr id="row_9_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_table_struct__msg__2eproto.html" target="_self">TableStruct_msg_2eproto</a></td><td class="desc"></td></tr>
<tr id="row_10_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_u_u_i_d_helper.html" target="_self">UUIDHelper</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
Expand Down
2 changes: 2 additions & 0 deletions docs/annotated_dup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var annotated_dup =
[ "MsgQueueManager", "class_xu_m_q_1_1_msg_queue_manager.html", "class_xu_m_q_1_1_msg_queue_manager" ],
[ "MsgQueueMapper", "class_xu_m_q_1_1_msg_queue_mapper.html", "class_xu_m_q_1_1_msg_queue_mapper" ],
[ "QueueMessage", "class_xu_m_q_1_1_queue_message.html", "class_xu_m_q_1_1_queue_message" ],
[ "Router", "class_xu_m_q_1_1_router.html", "class_xu_m_q_1_1_router" ],
[ "SqliteHelper", "class_xu_m_q_1_1_sqlite_helper.html", "class_xu_m_q_1_1_sqlite_helper" ],
[ "StrHelper", "class_xu_m_q_1_1_str_helper.html", "class_xu_m_q_1_1_str_helper" ],
[ "UUIDHelper", "class_xu_m_q_1_1_u_u_i_d_helper.html", "class_xu_m_q_1_1_u_u_i_d_helper" ],
Expand All @@ -33,6 +34,7 @@ var annotated_dup =
[ "is_proto_enum< ::XuMQ::DeliveryMode >", "structis__proto__enum_3_01_1_1_xu_m_q_1_1_delivery_mode_01_4.html", null ],
[ "is_proto_enum< ::XuMQ::ExchangeType >", "structis__proto__enum_3_01_1_1_xu_m_q_1_1_exchange_type_01_4.html", null ],
[ "QueueTest", "class_queue_test.html", "class_queue_test" ],
[ "RouteTest", "class_route_test.html", "class_route_test" ],
[ "TableStruct_msg_2eproto", "struct_table_struct__msg__2eproto.html", "struct_table_struct__msg__2eproto" ],
[ "UUIDHelper", "class_u_u_i_d_helper.html", "class_u_u_i_d_helper" ]
];
19 changes: 15 additions & 4 deletions docs/binding_8hpp.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
<div class="headertitle"><div class="title">binding.hpp 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>该文件包含消息队列绑定信息的管理类和结构体定义。
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="logger_8hpp_source.html">../common/logger.hpp</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="helper_8hpp_source.html">../common/helper.hpp</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="msg_8pb_8h_source.html">../common/msg.pb.h</a>&quot;</code><br />
Expand All @@ -115,7 +118,7 @@
<div class="dyncontent">
<div class="center"><img src="binding_8hpp__incl.png" border="0" usemap="#aserver_2binding_8hpp" alt=""/></div>
<map name="aserver_2binding_8hpp" id="aserver_2binding_8hpp">
<area shape="rect" title=" " alt="" coords="2631,5,2774,31"/>
<area shape="rect" title="该文件包含消息队列绑定信息的管理类和结构体定义。" alt="" coords="2631,5,2774,31"/>
<area shape="rect" href="logger_8hpp.html" title="异步日志器初始化" alt="" coords="5,159,168,185"/>
<area shape="poly" title=" " alt="" coords="2631,22,2224,25,1615,34,988,52,726,65,528,81,420,97,314,118,143,158,141,153,313,113,420,92,528,76,726,59,988,46,1615,28,2224,20,2631,17"/>
<area shape="rect" href="helper_8hpp.html" title="工具类封装" alt="" coords="835,79,997,104"/>
Expand Down Expand Up @@ -198,8 +201,8 @@
<div class="dyncontent">
<div class="center"><img src="binding_8hpp__dep__incl.png" border="0" usemap="#aserver_2binding_8hppdep" alt=""/></div>
<map name="aserver_2binding_8hppdep" id="aserver_2binding_8hppdep">
<area shape="rect" title=" " alt="" coords="95,5,238,31"/>
<area shape="rect" href="host_8hpp.html" title=" " alt="" coords="20,79,143,104"/>
<area shape="rect" title="该文件包含消息队列绑定信息的管理类和结构体定义。" alt="" coords="95,5,238,31"/>
<area shape="rect" href="host_8hpp.html" title="XuMQ 虚拟机模块定义" alt="" coords="20,79,143,104"/>
<area shape="poly" title=" " alt="" coords="144,41,97,80,94,76,141,37"/>
<area shape="rect" href="mqbindingtest_8cpp.html" title=" " alt="" coords="167,79,339,104"/>
<area shape="poly" title=" " alt="" coords="193,37,241,76,237,81,189,41"/>
Expand Down Expand Up @@ -236,7 +239,15 @@
<tr class="memdesc:a4970cc87d0e344f2b27f072e7172cff7"><td class="mdescLeft">&#160;</td><td class="mdescRight">绑定映射表-&mdash;交换机-&gt;消息队列绑定映射表的映射表 <br /></td></tr>
<tr class="separator:a4970cc87d0e344f2b27f072e7172cff7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>该文件包含消息队列绑定信息的管理类和结构体定义。 </p>
<p>本模块实现了消息队列与交换机的绑定信息管理,包括持久化管理和内存管理。</p>
<ol type="1">
<li>该模块主要负责消息队列与交换机之间的绑定关系的维护。</li>
<li>提供了对绑定信息的增删查改接口。</li>
<li>支持将绑定信息持久化到 SQLite 数据库中,以便于重启后恢复状态。 </li>
</ol>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
Expand Down
4 changes: 2 additions & 2 deletions docs/binding_8hpp__dep__incl.map
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<map id="server/binding.hpp" name="server/binding.hpp">
<area shape="rect" id="Node000001" title=" " alt="" coords="95,5,238,31"/>
<area shape="rect" id="Node000002" href="$host_8hpp.html" title=" " alt="" coords="20,79,143,104"/>
<area shape="rect" id="Node000001" title="该文件包含消息队列绑定信息的管理类和结构体定义。" alt="" coords="95,5,238,31"/>
<area shape="rect" id="Node000002" href="$host_8hpp.html" title="XuMQ 虚拟机模块定义" alt="" coords="20,79,143,104"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="144,41,97,80,94,76,141,37"/>
<area shape="rect" id="Node000004" href="$mqbindingtest_8cpp.html" title=" " alt="" coords="167,79,339,104"/>
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="193,37,241,76,237,81,189,41"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/binding_8hpp__dep__incl.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
52c118e072e1146f19541ec2202fd6c6
44a0d05bd33124a216cca53c49a64ebb
2 changes: 1 addition & 1 deletion docs/binding_8hpp__incl.map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<map id="server/binding.hpp" name="server/binding.hpp">
<area shape="rect" id="Node000001" title=" " alt="" coords="2631,5,2774,31"/>
<area shape="rect" id="Node000001" title="该文件包含消息队列绑定信息的管理类和结构体定义。" alt="" coords="2631,5,2774,31"/>
<area shape="rect" id="Node000002" href="$logger_8hpp.html" title="异步日志器初始化" alt="" coords="5,159,168,185"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="2631,22,2224,25,1615,34,988,52,726,65,528,81,420,97,314,118,143,158,141,153,313,113,420,92,528,76,726,59,988,46,1615,28,2224,20,2631,17"/>
<area shape="rect" id="Node000004" href="$helper_8hpp.html" title="工具类封装" alt="" coords="835,79,997,104"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/binding_8hpp__incl.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1136395fd35d60441c85a882af5ca8ff
659ef5b29fb6ef2fce14fe6c7d2e7551
Loading

0 comments on commit 908cafe

Please sign in to comment.