smart_message 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/deploy-github-pages.yml +38 -0
  3. data/.gitignore +5 -0
  4. data/CHANGELOG.md +30 -0
  5. data/Gemfile.lock +35 -4
  6. data/README.md +169 -71
  7. data/Rakefile +29 -4
  8. data/docs/assets/images/ddq_architecture.svg +130 -0
  9. data/docs/assets/images/dlq_architecture.svg +115 -0
  10. data/docs/assets/images/enhanced-dual-publishing.svg +136 -0
  11. data/docs/assets/images/enhanced-fluent-api.svg +149 -0
  12. data/docs/assets/images/enhanced-microservices-routing.svg +115 -0
  13. data/docs/assets/images/enhanced-pattern-matching.svg +107 -0
  14. data/docs/assets/images/fluent-api-demo.svg +59 -0
  15. data/docs/assets/images/performance-comparison.svg +161 -0
  16. data/docs/assets/images/redis-basic-architecture.svg +53 -0
  17. data/docs/assets/images/redis-enhanced-architecture.svg +88 -0
  18. data/docs/assets/images/redis-queue-architecture.svg +101 -0
  19. data/docs/assets/images/smart_message.jpg +0 -0
  20. data/docs/assets/images/smart_message_walking.jpg +0 -0
  21. data/docs/assets/images/smartmessage_architecture_overview.svg +173 -0
  22. data/docs/assets/images/transport-comparison-matrix.svg +171 -0
  23. data/docs/assets/javascripts/mathjax.js +17 -0
  24. data/docs/assets/stylesheets/extra.css +51 -0
  25. data/docs/{addressing.md → core-concepts/addressing.md} +5 -7
  26. data/docs/{architecture.md → core-concepts/architecture.md} +78 -138
  27. data/docs/{dispatcher.md → core-concepts/dispatcher.md} +21 -21
  28. data/docs/{message_filtering.md → core-concepts/message-filtering.md} +2 -3
  29. data/docs/{message_processing.md → core-concepts/message-processing.md} +17 -17
  30. data/docs/{troubleshooting.md → development/troubleshooting.md} +7 -7
  31. data/docs/{examples.md → getting-started/examples.md} +115 -89
  32. data/docs/{getting-started.md → getting-started/quick-start.md} +47 -18
  33. data/docs/guides/redis-queue-getting-started.md +697 -0
  34. data/docs/guides/redis-queue-patterns.md +889 -0
  35. data/docs/guides/redis-queue-production.md +1091 -0
  36. data/docs/index.md +64 -0
  37. data/docs/{dead_letter_queue.md → reference/dead-letter-queue.md} +2 -3
  38. data/docs/{logging.md → reference/logging.md} +1 -1
  39. data/docs/{message_deduplication.md → reference/message-deduplication.md} +1 -0
  40. data/docs/{proc_handlers_summary.md → reference/proc-handlers.md} +7 -6
  41. data/docs/{serializers.md → reference/serializers.md} +3 -5
  42. data/docs/{transports.md → reference/transports.md} +133 -11
  43. data/docs/transports/memory-transport.md +374 -0
  44. data/docs/transports/redis-enhanced-transport.md +524 -0
  45. data/docs/transports/redis-queue-transport.md +1304 -0
  46. data/docs/transports/redis-transport-comparison.md +496 -0
  47. data/docs/transports/redis-transport.md +509 -0
  48. data/examples/README.md +98 -5
  49. data/examples/city_scenario/911_emergency_call_flow.svg +99 -0
  50. data/examples/city_scenario/README.md +515 -0
  51. data/examples/city_scenario/ai_visitor_intelligence_flow.svg +108 -0
  52. data/examples/city_scenario/citizen.rb +195 -0
  53. data/examples/city_scenario/city_diagram.svg +125 -0
  54. data/examples/city_scenario/common/health_monitor.rb +80 -0
  55. data/examples/city_scenario/common/logger.rb +30 -0
  56. data/examples/city_scenario/emergency_dispatch_center.rb +270 -0
  57. data/examples/city_scenario/fire_department.rb +446 -0
  58. data/examples/city_scenario/fire_emergency_flow.svg +95 -0
  59. data/examples/city_scenario/health_department.rb +100 -0
  60. data/examples/city_scenario/health_monitoring_system.svg +130 -0
  61. data/examples/city_scenario/house.rb +244 -0
  62. data/examples/city_scenario/local_bank.rb +217 -0
  63. data/examples/city_scenario/messages/emergency_911_message.rb +81 -0
  64. data/examples/city_scenario/messages/emergency_resolved_message.rb +43 -0
  65. data/examples/city_scenario/messages/fire_dispatch_message.rb +43 -0
  66. data/examples/city_scenario/messages/fire_emergency_message.rb +45 -0
  67. data/examples/city_scenario/messages/health_check_message.rb +22 -0
  68. data/examples/city_scenario/messages/health_status_message.rb +35 -0
  69. data/examples/city_scenario/messages/police_dispatch_message.rb +46 -0
  70. data/examples/city_scenario/messages/silent_alarm_message.rb +38 -0
  71. data/examples/city_scenario/police_department.rb +316 -0
  72. data/examples/city_scenario/redis_monitor.rb +129 -0
  73. data/examples/city_scenario/redis_stats.rb +743 -0
  74. data/examples/city_scenario/room_for_improvement.md +240 -0
  75. data/examples/city_scenario/security_emergency_flow.svg +95 -0
  76. data/examples/city_scenario/service_internal_architecture.svg +154 -0
  77. data/examples/city_scenario/smart_message_ai_agent.rb +364 -0
  78. data/examples/city_scenario/start_demo.sh +236 -0
  79. data/examples/city_scenario/stop_demo.sh +106 -0
  80. data/examples/city_scenario/visitor.rb +631 -0
  81. data/examples/{10_message_deduplication.rb → memory/01_message_deduplication_demo.rb} +1 -1
  82. data/examples/{09_dead_letter_queue_demo.rb → memory/02_dead_letter_queue_demo.rb} +13 -40
  83. data/examples/{01_point_to_point_orders.rb → memory/03_point_to_point_orders.rb} +1 -1
  84. data/examples/{02_publish_subscribe_events.rb → memory/04_publish_subscribe_events.rb} +2 -2
  85. data/examples/{03_many_to_many_chat.rb → memory/05_many_to_many_chat.rb} +4 -4
  86. data/examples/{show_me.rb → memory/06_pretty_print_demo.rb} +1 -1
  87. data/examples/{05_proc_handlers.rb → memory/07_proc_handlers_demo.rb} +2 -2
  88. data/examples/{06_custom_logger_example.rb → memory/08_custom_logger_demo.rb} +17 -14
  89. data/examples/{07_error_handling_scenarios.rb → memory/09_error_handling_demo.rb} +4 -4
  90. data/examples/{08_entity_addressing_basic.rb → memory/10_entity_addressing_basic.rb} +8 -8
  91. data/examples/{08_entity_addressing_with_filtering.rb → memory/11_entity_addressing_with_filtering.rb} +6 -6
  92. data/examples/{09_regex_filtering_microservices.rb → memory/12_regex_filtering_microservices.rb} +2 -2
  93. data/examples/{10_header_block_configuration.rb → memory/13_header_block_configuration.rb} +6 -6
  94. data/examples/{11_global_configuration_example.rb → memory/14_global_configuration_demo.rb} +19 -8
  95. data/examples/{show_logger.rb → memory/15_logger_demo.rb} +1 -1
  96. data/examples/memory/README.md +163 -0
  97. data/examples/memory/memory_transport_architecture.svg +90 -0
  98. data/examples/memory/point_to_point_pattern.svg +94 -0
  99. data/examples/memory/publish_subscribe_pattern.svg +125 -0
  100. data/examples/{04_redis_smart_home_iot.rb → redis/01_smart_home_iot_demo.rb} +5 -5
  101. data/examples/redis/README.md +230 -0
  102. data/examples/redis/alert_system_flow.svg +127 -0
  103. data/examples/redis/dashboard_status_flow.svg +107 -0
  104. data/examples/redis/device_command_flow.svg +113 -0
  105. data/examples/redis/redis_transport_architecture.svg +115 -0
  106. data/examples/{smart_home_iot_dataflow.md → redis/smart_home_iot_dataflow.md} +4 -116
  107. data/examples/redis/smart_home_system_architecture.svg +133 -0
  108. data/examples/redis_enhanced/README.md +319 -0
  109. data/examples/redis_enhanced/enhanced_01_basic_patterns.rb +233 -0
  110. data/examples/redis_enhanced/enhanced_02_fluent_api.rb +331 -0
  111. data/examples/redis_enhanced/enhanced_03_dual_publishing.rb +281 -0
  112. data/examples/redis_enhanced/enhanced_04_advanced_routing.rb +419 -0
  113. data/examples/redis_queue/01_basic_messaging.rb +221 -0
  114. data/examples/redis_queue/01_comprehensive_examples.rb +508 -0
  115. data/examples/redis_queue/02_pattern_routing.rb +405 -0
  116. data/examples/redis_queue/03_fluent_api.rb +422 -0
  117. data/examples/redis_queue/04_load_balancing.rb +486 -0
  118. data/examples/redis_queue/05_microservices.rb +735 -0
  119. data/examples/redis_queue/06_emergency_alerts.rb +777 -0
  120. data/examples/redis_queue/07_queue_management.rb +587 -0
  121. data/examples/redis_queue/README.md +366 -0
  122. data/examples/redis_queue/enhanced_01_basic_patterns.rb +233 -0
  123. data/examples/redis_queue/enhanced_02_fluent_api.rb +331 -0
  124. data/examples/redis_queue/enhanced_03_dual_publishing.rb +281 -0
  125. data/examples/redis_queue/enhanced_04_advanced_routing.rb +419 -0
  126. data/examples/redis_queue/redis_queue_architecture.svg +148 -0
  127. data/ideas/README.md +41 -0
  128. data/ideas/agents.md +1001 -0
  129. data/ideas/database_transport.md +980 -0
  130. data/ideas/improvement.md +359 -0
  131. data/ideas/meshage.md +1788 -0
  132. data/ideas/message_discovery.md +178 -0
  133. data/ideas/message_schema.md +1381 -0
  134. data/lib/smart_message/.idea/.gitignore +8 -0
  135. data/lib/smart_message/.idea/markdown.xml +6 -0
  136. data/lib/smart_message/.idea/misc.xml +4 -0
  137. data/lib/smart_message/.idea/modules.xml +8 -0
  138. data/lib/smart_message/.idea/smart_message.iml +16 -0
  139. data/lib/smart_message/.idea/vcs.xml +6 -0
  140. data/lib/smart_message/addressing.rb +15 -0
  141. data/lib/smart_message/base.rb +0 -2
  142. data/lib/smart_message/configuration.rb +1 -1
  143. data/lib/smart_message/logger.rb +15 -4
  144. data/lib/smart_message/plugins.rb +5 -2
  145. data/lib/smart_message/serializer.rb +14 -0
  146. data/lib/smart_message/transport/redis_enhanced_transport.rb +399 -0
  147. data/lib/smart_message/transport/redis_queue_transport.rb +555 -0
  148. data/lib/smart_message/transport/registry.rb +1 -0
  149. data/lib/smart_message/transport.rb +34 -1
  150. data/lib/smart_message/version.rb +1 -1
  151. data/lib/smart_message.rb +5 -52
  152. data/mkdocs.yml +184 -0
  153. data/p2p_plan.md +326 -0
  154. data/p2p_roadmap.md +287 -0
  155. data/smart_message.gemspec +2 -0
  156. data/smart_message.svg +51 -0
  157. metadata +170 -44
  158. data/docs/README.md +0 -57
  159. data/examples/dead_letters.jsonl +0 -12
  160. data/examples/temp.txt +0 -94
  161. data/examples/tmux_chat/README.md +0 -283
  162. data/examples/tmux_chat/bot_agent.rb +0 -278
  163. data/examples/tmux_chat/human_agent.rb +0 -199
  164. data/examples/tmux_chat/room_monitor.rb +0 -160
  165. data/examples/tmux_chat/shared_chat_system.rb +0 -328
  166. data/examples/tmux_chat/start_chat_demo.sh +0 -190
  167. data/examples/tmux_chat/stop_chat_demo.sh +0 -22
  168. /data/docs/{properties.md → core-concepts/properties.md} +0 -0
  169. /data/docs/{ideas_to_think_about.md → development/ideas.md} +0 -0
@@ -0,0 +1,130 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="800" height="500" viewBox="0 0 800 500" xmlns="http://www.w3.org/2000/svg">
3
+ <defs>
4
+ <style>
5
+ .bg { fill: transparent; }
6
+ .handler-a-group { fill: #1a2a3a; stroke: #4a9eff; stroke-width: 2; rx: 10; }
7
+ .handler-b-group { fill: #2a1a3a; stroke: #aa4aff; stroke-width: 2; rx: 10; }
8
+ .dispatcher-group { fill: #3a1a1a; stroke: #ff4a4a; stroke-width: 2; rx: 10; }
9
+ .component { fill: #2a2a2a; stroke: #ffffff; stroke-width: 1; rx: 5; }
10
+ .message { fill: #1a3a2a; stroke: #4aff4a; stroke-width: 2; rx: 8; }
11
+ .process-flow { stroke: #4aff4a; stroke-width: 3; fill: none; marker-end: url(#arrowhead-green); }
12
+ .check-flow { stroke: #ffaa4a; stroke-width: 2; fill: none; marker-end: url(#arrowhead-orange); }
13
+ .success-flow { stroke: #4aff4a; stroke-width: 2; fill: none; marker-end: url(#arrowhead-green); }
14
+ .skip-flow { stroke: #ff4a4a; stroke-width: 2; fill: none; marker-end: url(#arrowhead-red); stroke-dasharray: 5,5; }
15
+ .add-flow { stroke: #4a9eff; stroke-width: 2; fill: none; marker-end: url(#arrowhead-blue); }
16
+ .text { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 11px; }
17
+ .title { fill: #4a9eff; font-family: 'Arial', sans-serif; font-size: 18px; font-weight: bold; }
18
+ .group-title { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 13px; font-weight: bold; }
19
+ .component-title { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 12px; font-weight: bold; }
20
+ .note { fill: #aaaaaa; font-family: 'Arial', sans-serif; font-size: 10px; }
21
+ </style>
22
+ <marker id="arrowhead-green" markerWidth="8" markerHeight="6"
23
+ refX="8" refY="3" orient="auto">
24
+ <polygon points="0 0, 8 3, 0 6" fill="#4aff4a" />
25
+ </marker>
26
+ <marker id="arrowhead-orange" markerWidth="8" markerHeight="6"
27
+ refX="8" refY="3" orient="auto">
28
+ <polygon points="0 0, 8 3, 0 6" fill="#ffaa4a" />
29
+ </marker>
30
+ <marker id="arrowhead-red" markerWidth="8" markerHeight="6"
31
+ refX="8" refY="3" orient="auto">
32
+ <polygon points="0 0, 8 3, 0 6" fill="#ff4a4a" />
33
+ </marker>
34
+ <marker id="arrowhead-blue" markerWidth="8" markerHeight="6"
35
+ refX="8" refY="3" orient="auto">
36
+ <polygon points="0 0, 8 3, 0 6" fill="#4a9eff" />
37
+ </marker>
38
+ </defs>
39
+
40
+ <!-- Background -->
41
+ <rect class="bg" width="800" height="500"/>
42
+
43
+ <!-- Title -->
44
+ <text x="400" y="25" text-anchor="middle" class="title">DDQ Architecture - Handler-Scoped Deduplication</text>
45
+
46
+ <!-- Handler A DDQ Group -->
47
+ <rect x="50" y="80" width="200" height="180" class="handler-a-group"/>
48
+ <text x="150" y="100" text-anchor="middle" class="group-title">Handler A DDQ</text>
49
+
50
+ <rect x="70" y="120" width="160" height="40" class="component"/>
51
+ <text x="150" y="135" text-anchor="middle" class="component-title">Circular Array</text>
52
+ <text x="150" y="150" text-anchor="middle" class="text">FIFO UUID Storage</text>
53
+
54
+ <rect x="70" y="170" width="160" height="40" class="component"/>
55
+ <text x="150" y="185" text-anchor="middle" class="component-title">Lookup Set</text>
56
+ <text x="150" y="200" text-anchor="middle" class="text">O(1) Duplicate Check</text>
57
+
58
+ <rect x="70" y="220" width="160" height="30" class="component"/>
59
+ <text x="150" y="240" text-anchor="middle" class="component-title">Mutex Lock</text>
60
+
61
+ <!-- Handler B DDQ Group -->
62
+ <rect x="300" y="80" width="200" height="180" class="handler-b-group"/>
63
+ <text x="400" y="100" text-anchor="middle" class="group-title">Handler B DDQ</text>
64
+
65
+ <rect x="320" y="120" width="160" height="40" class="component"/>
66
+ <text x="400" y="135" text-anchor="middle" class="component-title">Circular Array</text>
67
+ <text x="400" y="150" text-anchor="middle" class="text">FIFO UUID Storage</text>
68
+
69
+ <rect x="320" y="170" width="160" height="40" class="component"/>
70
+ <text x="400" y="185" text-anchor="middle" class="component-title">Lookup Set</text>
71
+ <text x="400" y="200" text-anchor="middle" class="text">O(1) Duplicate Check</text>
72
+
73
+ <rect x="320" y="220" width="160" height="30" class="component"/>
74
+ <text x="400" y="240" text-anchor="middle" class="component-title">Mutex Lock</text>
75
+
76
+ <!-- Message and Dispatcher -->
77
+ <rect x="50" y="300" width="180" height="60" class="message"/>
78
+ <text x="140" y="320" text-anchor="middle" class="component-title">Incoming Message</text>
79
+ <text x="140" y="335" text-anchor="middle" class="text">UUID: abc-123</text>
80
+ <text x="140" y="350" text-anchor="middle" class="text">Data: { order_id: "123" }</text>
81
+
82
+ <rect x="300" y="300" width="120" height="60" class="dispatcher-group"/>
83
+ <text x="360" y="325" text-anchor="middle" class="component-title">Dispatcher</text>
84
+ <text x="360" y="340" text-anchor="middle" class="text">Route to handlers</text>
85
+ <text x="360" y="355" text-anchor="middle" class="text">Check DDQ per handler</text>
86
+
87
+ <!-- Process Results -->
88
+ <rect x="520" y="120" width="140" height="40" class="component"/>
89
+ <text x="590" y="135" text-anchor="middle" class="component-title">Process with Handler A</text>
90
+ <text x="590" y="150" text-anchor="middle" class="text">✅ UUID Not Found - Process</text>
91
+
92
+ <rect x="520" y="180" width="140" height="40" class="component"/>
93
+ <text x="590" y="195" text-anchor="middle" class="component-title">Skip Handler B</text>
94
+ <text x="590" y="210" text-anchor="middle" class="text">❌ UUID Found - Duplicate</text>
95
+
96
+ <!-- Flow arrows -->
97
+ <!-- Message to Dispatcher -->
98
+ <path d="M 230 330 L 300 330" class="process-flow"/>
99
+
100
+ <!-- Dispatcher to DDQ checks -->
101
+ <path d="M 360 300 L 150 210" class="check-flow"/>
102
+ <path d="M 360 300 L 400 210" class="check-flow"/>
103
+
104
+ <!-- DDQ A to Process (Not Found) -->
105
+ <path d="M 250 190 L 520 140" class="success-flow"/>
106
+
107
+ <!-- DDQ B to Skip (Found) -->
108
+ <path d="M 500 190 L 520 200" class="skip-flow"/>
109
+
110
+ <!-- Process A to add UUID back to DDQ A -->
111
+ <path d="M 590 160 L 590 280 L 150 280 L 150 160" class="add-flow"/>
112
+ <text x="480" y="275" class="note">Add UUID to Array &amp; Set</text>
113
+
114
+ <!-- Labels -->
115
+ <text x="280" y="125" class="note">Check Handler A</text>
116
+ <text x="280" y="195" class="note">Check Handler B</text>
117
+ <text x="370" y="125" class="note">Not Found</text>
118
+ <text x="420" y="195" class="note">Found</text>
119
+
120
+ <!-- Architecture Details -->
121
+ <rect x="50" y="400" width="700" height="80" fill="#1a1a1a" stroke="#4a9eff" rx="8"/>
122
+ <text x="70" y="425" class="component-title">Key Features:</text>
123
+ <text x="90" y="440" class="text">• Handler Isolation: Each subscription gets its own DDQ instance</text>
124
+ <text x="90" y="455" class="text">• O(1) Performance: Hybrid Array + Set data structure for optimal speed</text>
125
+ <text x="90" y="470" class="text">• Thread Safety: Mutex locks prevent race conditions in concurrent processing</text>
126
+
127
+ <text x="420" y="440" class="text">• Memory Efficient: Circular buffer prevents unbounded growth</text>
128
+ <text x="420" y="455" class="text">• Storage Backends: Memory (default) or Redis for persistence</text>
129
+ <text x="420" y="470" class="text">• Automatic Cleanup: UUIDs are automatically evicted via circular buffer</text>
130
+ </svg>
@@ -0,0 +1,115 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="700" height="400" viewBox="0 0 700 400" xmlns="http://www.w3.org/2000/svg">
3
+ <defs>
4
+ <style>
5
+ .bg { fill: transparent; }
6
+ .publish-group { fill: #1a3a2a; stroke: #4aff4a; stroke-width: 2; rx: 8; }
7
+ .circuit-group { fill: #3a2a1a; stroke: #ffaa4a; stroke-width: 2; rx: 8; }
8
+ .transport-group { fill: #1a2a3a; stroke: #4a9eff; stroke-width: 2; rx: 8; }
9
+ .dlq-group { fill: #3a1a1a; stroke: #ff4a4a; stroke-width: 2; rx: 8; }
10
+ .replay-group { fill: #2a1a3a; stroke: #aa4aff; stroke-width: 2; rx: 8; }
11
+ .success-flow { stroke: #4aff4a; stroke-width: 3; fill: none; marker-end: url(#arrowhead-green); }
12
+ .failure-flow { stroke: #ff4a4a; stroke-width: 3; fill: none; marker-end: url(#arrowhead-red); }
13
+ .retry-flow { stroke: #aa4aff; stroke-width: 3; fill: none; marker-end: url(#arrowhead-purple); stroke-dasharray: 6,6; }
14
+ .monitor-flow { stroke: #ffaa4a; stroke-width: 2; fill: none; marker-end: url(#arrowhead-orange); }
15
+ .text { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 11px; }
16
+ .title { fill: #4a9eff; font-family: 'Arial', sans-serif; font-size: 18px; font-weight: bold; }
17
+ .component-title { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 13px; font-weight: bold; }
18
+ .note { fill: #aaaaaa; font-family: 'Arial', sans-serif; font-size: 10px; }
19
+ </style>
20
+ <marker id="arrowhead-green" markerWidth="8" markerHeight="6"
21
+ refX="8" refY="3" orient="auto">
22
+ <polygon points="0 0, 8 3, 0 6" fill="#4aff4a" />
23
+ </marker>
24
+ <marker id="arrowhead-red" markerWidth="8" markerHeight="6"
25
+ refX="8" refY="3" orient="auto">
26
+ <polygon points="0 0, 8 3, 0 6" fill="#ff4a4a" />
27
+ </marker>
28
+ <marker id="arrowhead-purple" markerWidth="8" markerHeight="6"
29
+ refX="8" refY="3" orient="auto">
30
+ <polygon points="0 0, 8 3, 0 6" fill="#aa4aff" />
31
+ </marker>
32
+ <marker id="arrowhead-orange" markerWidth="8" markerHeight="6"
33
+ refX="8" refY="3" orient="auto">
34
+ <polygon points="0 0, 8 3, 0 6" fill="#ffaa4a" />
35
+ </marker>
36
+ </defs>
37
+
38
+ <!-- Background -->
39
+ <rect class="bg" width="700" height="400"/>
40
+
41
+ <!-- Title -->
42
+ <text x="350" y="25" text-anchor="middle" class="title">Dead Letter Queue Architecture</text>
43
+
44
+ <!-- Message Publishing -->
45
+ <rect x="50" y="70" width="120" height="50" class="publish-group"/>
46
+ <text x="110" y="90" text-anchor="middle" class="component-title">Message</text>
47
+ <text x="110" y="105" text-anchor="middle" class="component-title">Publishing</text>
48
+
49
+ <!-- Circuit Breaker Monitoring -->
50
+ <rect x="220" y="70" width="120" height="50" class="circuit-group"/>
51
+ <text x="280" y="85" text-anchor="middle" class="component-title">Circuit Breaker</text>
52
+ <text x="280" y="100" text-anchor="middle" class="component-title">Monitoring</text>
53
+ <text x="280" y="115" text-anchor="middle" class="text">Failure Detection</text>
54
+
55
+ <!-- Transport Success -->
56
+ <rect x="390" y="50" width="120" height="50" class="transport-group"/>
57
+ <text x="450" y="70" text-anchor="middle" class="component-title">Transport</text>
58
+ <text x="450" y="85" text-anchor="middle" class="component-title">Success</text>
59
+ <text x="450" y="100" text-anchor="middle" class="text">Message Delivered</text>
60
+
61
+ <!-- Dead Letter Queue -->
62
+ <rect x="390" y="140" width="120" height="60" class="dlq-group"/>
63
+ <text x="450" y="160" text-anchor="middle" class="component-title">Dead Letter Queue</text>
64
+ <text x="450" y="175" text-anchor="middle" class="component-title">Failure Storage</text>
65
+ <text x="450" y="190" text-anchor="middle" class="text">JSON Lines Format</text>
66
+
67
+ <!-- Replay Mechanism -->
68
+ <rect x="220" y="180" width="120" height="60" class="replay-group"/>
69
+ <text x="280" y="200" text-anchor="middle" class="component-title">Replay Mechanism</text>
70
+ <text x="280" y="215" text-anchor="middle" class="text">Manual/Automated</text>
71
+ <text x="280" y="230" text-anchor="middle" class="text">Transport Override</text>
72
+
73
+ <!-- Flow arrows -->
74
+ <!-- Publishing to Circuit Breaker -->
75
+ <path d="M 170 95 L 220 95" class="monitor-flow"/>
76
+
77
+ <!-- Circuit Breaker Success -->
78
+ <path d="M 340 85 L 390 75" class="success-flow"/>
79
+ <text x="345" y="75" class="text">Success</text>
80
+
81
+ <!-- Circuit Breaker Failure -->
82
+ <path d="M 340 105 L 390 170" class="failure-flow"/>
83
+ <text x="345" y="140" class="text">Failure</text>
84
+
85
+ <!-- DLQ to Replay -->
86
+ <path d="M 390 190 L 340 210" class="retry-flow"/>
87
+
88
+ <!-- Replay to Publishing (Retry) -->
89
+ <path d="M 220 210 L 110 210 L 110 120" class="retry-flow"/>
90
+ <text x="120" y="205" class="text">Retry</text>
91
+
92
+ <!-- DLQ Features -->
93
+ <rect x="50" y="280" width="600" height="100" fill="#1a1a1a" stroke="#4a9eff" rx="8"/>
94
+ <text x="70" y="305" class="component-title">DLQ Features:</text>
95
+
96
+ <text x="70" y="325" class="text">• JSON Lines Format: Efficient append operations with one message per line</text>
97
+ <text x="70" y="340" class="text">• FIFO Queue Operations: First-in, first-out processing with thread safety</text>
98
+ <text x="70" y="355" class="text">• Replay Capabilities: Manual and automated retry with transport override support</text>
99
+ <text x="70" y="370" class="text">• Administrative Tools: Message filtering, analysis, and selective replay functionality</text>
100
+
101
+ <!-- Circuit Breaker States -->
102
+ <rect x="550" y="70" width="120" height="140" fill="#2a2a2a" stroke="#ffaa4a" rx="8"/>
103
+ <text x="610" y="90" text-anchor="middle" class="component-title">Circuit States</text>
104
+
105
+ <rect x="560" y="100" width="100" height="25" fill="#1a3a1a" stroke="#4aff4a" rx="3"/>
106
+ <text x="610" y="117" text-anchor="middle" class="text">CLOSED: Normal</text>
107
+
108
+ <rect x="560" y="130" width="100" height="25" fill="#3a1a1a" stroke="#ff4a4a" rx="3"/>
109
+ <text x="610" y="147" text-anchor="middle" class="text">OPEN: Failing</text>
110
+
111
+ <rect x="560" y="160" width="100" height="25" fill="#3a2a1a" stroke="#ffaa4a" rx="3"/>
112
+ <text x="610" y="177" text-anchor="middle" class="text">HALF-OPEN: Test</text>
113
+
114
+ <text x="610" y="200" text-anchor="middle" class="note">Automatic state transitions</text>
115
+ </svg>
@@ -0,0 +1,136 @@
1
+ <svg width="900" height="600" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
2
+ <defs>
3
+ <style>
4
+ .title { font: bold 18px sans-serif; fill: #e1e5e9; text-anchor: middle; }
5
+ .label { font: 14px sans-serif; fill: #c9d1d9; text-anchor: middle; }
6
+ .small-label { font: 12px sans-serif; fill: #8b949e; text-anchor: middle; }
7
+ .code-label { font: 11px monospace; fill: #f0f6fc; }
8
+ .box { fill: #21262d; stroke: #30363d; stroke-width: 2; rx: 8; }
9
+ .enhanced-box { fill: #0d1117; stroke: #a5a5ff; stroke-width: 2; rx: 8; }
10
+ .basic-box { fill: #161b22; stroke: #56d364; stroke-width: 2; rx: 8; }
11
+ .channel-box { fill: #1a1d2e; stroke: #ffa657; stroke-width: 2; rx: 6; }
12
+ .subscriber-box { fill: #0d1117; stroke: #f85149; stroke-width: 2; rx: 6; }
13
+ .arrow { stroke: #58a6ff; stroke-width: 2; fill: none; marker-end: url(#arrowhead); }
14
+ .dual-arrow { stroke: #a5a5ff; stroke-width: 3; fill: none; marker-end: url(#arrowhead-purple); }
15
+ .basic-arrow { stroke: #56d364; stroke-width: 2; fill: none; marker-end: url(#arrowhead-green); }
16
+ </style>
17
+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
18
+ <polygon points="0 0, 10 3.5, 0 7" fill="#58a6ff" />
19
+ </marker>
20
+ <marker id="arrowhead-purple" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
21
+ <polygon points="0 0, 10 3.5, 0 7" fill="#a5a5ff" />
22
+ </marker>
23
+ <marker id="arrowhead-green" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
24
+ <polygon points="0 0, 10 3.5, 0 7" fill="#56d364" />
25
+ </marker>
26
+ </defs>
27
+
28
+ <!-- Title -->
29
+ <text x="450" y="30" class="title">Redis Enhanced Transport: Dual Publishing</text>
30
+
31
+ <!-- Publisher Section -->
32
+ <rect x="50" y="60" width="160" height="80" class="enhanced-box"/>
33
+ <text x="130" y="85" class="label">Enhanced Publisher</text>
34
+ <text x="130" y="105" class="small-label">OrderMessage</text>
35
+ <text x="130" y="120" class="code-label">from: 'api-gateway'</text>
36
+ <text x="130" y="135" class="code-label">to: 'order-service'</text>
37
+
38
+ <!-- Dual Channel Publishing -->
39
+ <text x="450" y="70" class="label">Dual Channel Publishing</text>
40
+
41
+ <!-- Original Channel -->
42
+ <rect x="300" y="100" width="300" height="40" class="channel-box"/>
43
+ <text x="320" y="115" class="small-label">Original Channel (Basic Compatible):</text>
44
+ <text x="320" y="130" class="code-label">"OrderMessage"</text>
45
+
46
+ <!-- Enhanced Channel -->
47
+ <rect x="300" y="150" width="300" height="40" class="channel-box"/>
48
+ <text x="320" y="165" class="small-label">Enhanced Channel (Pattern-based):</text>
49
+ <text x="320" y="180" class="code-label">"ordermessage.api_gateway.order_service"</text>
50
+
51
+ <!-- Arrows from publisher to channels -->
52
+ <line x1="210" y1="95" x2="300" y2="120" class="dual-arrow"/>
53
+ <line x1="210" y1="125" x2="300" y2="170" class="dual-arrow"/>
54
+
55
+ <!-- Subscribers Section -->
56
+ <text x="750" y="70" class="label">Subscribers</text>
57
+
58
+ <!-- Basic Subscriber -->
59
+ <rect x="650" y="100" width="160" height="40" class="basic-box"/>
60
+ <text x="730" y="115" class="small-label">Basic Subscriber</text>
61
+ <text x="730" y="130" class="code-label">subscribe("OrderMessage")</text>
62
+
63
+ <!-- Enhanced Subscriber -->
64
+ <rect x="650" y="150" width="160" height="40" class="enhanced-box"/>
65
+ <text x="730" y="165" class="small-label">Enhanced Subscriber</text>
66
+ <text x="730" y="180" class="code-label">pattern: "ordermessage.*.*"</text>
67
+
68
+ <!-- Arrows from channels to subscribers -->
69
+ <line x1="600" y1="120" x2="650" y2="120" class="basic-arrow"/>
70
+ <line x1="600" y1="170" x2="650" y2="170" class="dual-arrow"/>
71
+
72
+ <!-- Compatibility Matrix -->
73
+ <rect x="50" y="240" width="800" height="200" class="box"/>
74
+ <text x="450" y="265" class="label">Transport Compatibility Matrix</text>
75
+
76
+ <!-- Headers -->
77
+ <rect x="70" y="280" width="150" height="30" class="enhanced-box"/>
78
+ <text x="145" y="300" class="small-label">Publisher Type</text>
79
+
80
+ <rect x="220" y="280" width="150" height="30" class="basic-box"/>
81
+ <text x="295" y="300" class="small-label">Basic Subscriber</text>
82
+
83
+ <rect x="370" y="280" width="150" height="30" class="enhanced-box"/>
84
+ <text x="445" y="300" class="small-label">Enhanced Subscriber</text>
85
+
86
+ <rect x="520" y="280" width="300" height="30" class="channel-box"/>
87
+ <text x="670" y="300" class="small-label">Channels Used</text>
88
+
89
+ <!-- Basic Publisher Row -->
90
+ <rect x="70" y="310" width="150" height="40" class="basic-box"/>
91
+ <text x="145" y="325" class="small-label">Basic Publisher</text>
92
+ <text x="145" y="340" class="code-label">publish(message)</text>
93
+
94
+ <rect x="220" y="310" width="150" height="40" class="subscriber-box"/>
95
+ <text x="295" y="325" class="small-label">✅ Receives</text>
96
+ <text x="295" y="340" class="code-label">Direct match</text>
97
+
98
+ <rect x="370" y="310" width="150" height="40" class="subscriber-box"/>
99
+ <text x="445" y="325" class="small-label">❌ No Match</text>
100
+ <text x="445" y="340" class="code-label">Pattern mismatch</text>
101
+
102
+ <rect x="520" y="310" width="300" height="40" class="channel-box"/>
103
+ <text x="670" y="325" class="code-label">["OrderMessage"]</text>
104
+ <text x="670" y="340" class="small-label">Original channel only</text>
105
+
106
+ <!-- Enhanced Publisher Row -->
107
+ <rect x="70" y="350" width="150" height="40" class="enhanced-box"/>
108
+ <text x="145" y="365" class="small-label">Enhanced Publisher</text>
109
+ <text x="145" y="380" class="code-label">publish(message)</text>
110
+
111
+ <rect x="220" y="350" width="150" height="40" class="subscriber-box"/>
112
+ <text x="295" y="365" class="small-label">✅ Receives</text>
113
+ <text x="295" y="380" class="code-label">Original channel</text>
114
+
115
+ <rect x="370" y="350" width="150" height="40" class="subscriber-box"/>
116
+ <text x="445" y="365" class="small-label">✅ Receives</text>
117
+ <text x="445" y="380" class="code-label">Enhanced channel</text>
118
+
119
+ <rect x="520" y="350" width="300" height="40" class="channel-box"/>
120
+ <text x="670" y="365" class="code-label">["OrderMessage",</text>
121
+ <text x="670" y="380" class="code-label">"ordermessage.api.order"]</text>
122
+
123
+ <!-- Migration Benefits -->
124
+ <rect x="50" y="460" width="800" height="120" class="box"/>
125
+ <text x="450" y="485" class="label">Migration &amp; Compatibility Benefits</text>
126
+
127
+ <text x="200" y="510" class="small-label">🔄 Gradual Migration</text>
128
+ <text x="70" y="530" class="code-label">• Upgrade publishers to Enhanced without breaking existing subscribers</text>
129
+ <text x="70" y="545" class="code-label">• Legacy Basic subscribers continue to work unchanged</text>
130
+ <text x="70" y="560" class="code-label">• New Enhanced subscribers get pattern-matching benefits</text>
131
+
132
+ <text x="650" y="510" class="small-label">⚡ Performance</text>
133
+ <text x="520" y="530" class="code-label">• No performance penalty for dual publishing</text>
134
+ <text x="520" y="545" class="code-label">• Redis handles both channels efficiently</text>
135
+ <text x="520" y="560" class="code-label">• Pattern matching happens at subscriber</text>
136
+ </svg>
@@ -0,0 +1,149 @@
1
+ <svg width="900" height="600" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
2
+ <defs>
3
+ <style>
4
+ .title { font: bold 18px sans-serif; fill: #e1e5e9; text-anchor: middle; }
5
+ .label { font: 14px sans-serif; fill: #c9d1d9; text-anchor: middle; }
6
+ .small-label { font: 12px sans-serif; fill: #8b949e; }
7
+ .code-label { font: 11px monospace; fill: #f0f6fc; }
8
+ .keyword { font: 11px monospace; fill: #ff7b72; font-weight: bold; }
9
+ .string { font: 11px monospace; fill: #a5d6ff; }
10
+ .comment { font: 11px monospace; fill: #8b949e; font-style: italic; }
11
+ .box { fill: #21262d; stroke: #30363d; stroke-width: 2; rx: 8; }
12
+ .code-box { fill: #0d1117; stroke: #a5a5ff; stroke-width: 2; rx: 6; }
13
+ .result-box { fill: #161b22; stroke: #56d364; stroke-width: 2; rx: 6; }
14
+ .chain-box { fill: #1a1d2e; stroke: #ffa657; stroke-width: 2; rx: 6; }
15
+ .arrow { stroke: #58a6ff; stroke-width: 2; fill: none; marker-end: url(#arrowhead); }
16
+ .chain-arrow { stroke: #ffa657; stroke-width: 2; fill: none; marker-end: url(#arrowhead-orange); }
17
+ </style>
18
+ <marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
19
+ <polygon points="0 0, 10 3.5, 0 7" fill="#58a6ff" />
20
+ </marker>
21
+ <marker id="arrowhead-orange" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
22
+ <polygon points="0 0, 10 3.5, 0 7" fill="#ffa657" />
23
+ </marker>
24
+ </defs>
25
+
26
+ <!-- Title -->
27
+ <text x="450" y="30" class="title">Redis Enhanced Transport: Fluent API</text>
28
+
29
+ <!-- Basic Fluent API Examples -->
30
+ <text x="450" y="65" class="label">Fluent API Pattern Building</text>
31
+
32
+ <!-- Example 1: Simple from() -->
33
+ <rect x="50" y="80" width="350" height="40" class="code-box"/>
34
+ <text x="60" y="100" class="code-label">transport.</text>
35
+ <text x="130" y="100" class="keyword">where</text>
36
+ <text x="170" y="100" class="code-label">.</text>
37
+ <text x="180" y="100" class="keyword">from</text>
38
+ <text x="210" y="100" class="code-label">(</text>
39
+ <text x="220" y="100" class="string">'web-app'</text>
40
+ <text x="280" y="100" class="code-label">).</text>
41
+ <text x="300" y="100" class="keyword">subscribe</text>
42
+ <text x="60" y="115" class="comment"># Pattern: *.web-app.*</text>
43
+
44
+ <rect x="450" y="80" width="200" height="40" class="result-box"/>
45
+ <text x="460" y="100" class="small-label">Generated Pattern:</text>
46
+ <text x="460" y="115" class="code-label">*.web-app.*</text>
47
+
48
+ <!-- Arrow -->
49
+ <line x1="400" y1="100" x2="450" y2="100" class="arrow"/>
50
+
51
+ <!-- Example 2: Combined from() and to() -->
52
+ <rect x="50" y="140" width="350" height="40" class="code-box"/>
53
+ <text x="60" y="160" class="code-label">transport.</text>
54
+ <text x="130" y="160" class="keyword">where</text>
55
+ <text x="170" y="160" class="code-label">.</text>
56
+ <text x="180" y="160" class="keyword">from</text>
57
+ <text x="210" y="160" class="code-label">(</text>
58
+ <text x="220" y="160" class="string">'api'</text>
59
+ <text x="250" y="160" class="code-label">).</text>
60
+ <text x="270" y="160" class="keyword">to</text>
61
+ <text x="290" y="160" class="code-label">(</text>
62
+ <text x="300" y="160" class="string">'db'</text>
63
+ <text x="320" y="160" class="code-label">).</text>
64
+ <text x="340" y="160" class="keyword">subscribe</text>
65
+ <text x="60" y="175" class="comment"># Pattern: *.api.db</text>
66
+
67
+ <rect x="450" y="140" width="200" height="40" class="result-box"/>
68
+ <text x="460" y="160" class="small-label">Generated Pattern:</text>
69
+ <text x="460" y="175" class="code-label">*.api.db</text>
70
+
71
+ <!-- Arrow -->
72
+ <line x1="400" y1="160" x2="450" y2="160" class="arrow"/>
73
+
74
+ <!-- Example 3: Complex type, from, to -->
75
+ <rect x="50" y="200" width="400" height="40" class="code-box"/>
76
+ <text x="60" y="220" class="code-label">transport.</text>
77
+ <text x="130" y="220" class="keyword">where</text>
78
+ <text x="170" y="220" class="code-label">.</text>
79
+ <text x="180" y="220" class="keyword">type</text>
80
+ <text x="210" y="220" class="code-label">(</text>
81
+ <text x="220" y="220" class="string">'Order'</text>
82
+ <text x="260" y="220" class="code-label">).</text>
83
+ <text x="280" y="220" class="keyword">from</text>
84
+ <text x="310" y="220" class="code-label">(</text>
85
+ <text x="320" y="220" class="string">'web'</text>
86
+ <text x="350" y="220" class="code-label">).</text>
87
+ <text x="370" y="220" class="keyword">subscribe</text>
88
+ <text x="60" y="235" class="comment"># Pattern: order.web.*</text>
89
+
90
+ <rect x="500" y="200" width="200" height="40" class="result-box"/>
91
+ <text x="510" y="220" class="small-label">Generated Pattern:</text>
92
+ <text x="510" y="235" class="code-label">order.web.*</text>
93
+
94
+ <!-- Arrow -->
95
+ <line x1="450" y1="220" x2="500" y2="220" class="arrow"/>
96
+
97
+ <!-- Chaining Visualization -->
98
+ <rect x="50" y="280" width="800" height="160" class="box"/>
99
+ <text x="450" y="305" class="label">Method Chaining Visualization</text>
100
+
101
+ <!-- Step-by-step chain -->
102
+ <rect x="70" y="320" width="100" height="30" class="chain-box"/>
103
+ <text x="120" y="340" class="code-label">transport</text>
104
+
105
+ <rect x="200" y="320" width="80" height="30" class="chain-box"/>
106
+ <text x="240" y="340" class="keyword">.where</text>
107
+
108
+ <rect x="310" y="320" width="110" height="30" class="chain-box"/>
109
+ <text x="365" y="340" class="code-label">.from('api')</text>
110
+
111
+ <rect x="450" y="320" width="100" height="30" class="chain-box"/>
112
+ <text x="500" y="340" class="code-label">.to('db')</text>
113
+
114
+ <rect x="580" y="320" width="100" height="30" class="chain-box"/>
115
+ <text x="630" y="340" class="keyword">.subscribe</text>
116
+
117
+ <!-- Chain arrows -->
118
+ <line x1="170" y1="335" x2="200" y2="335" class="chain-arrow"/>
119
+ <line x1="280" y1="335" x2="310" y2="335" class="chain-arrow"/>
120
+ <line x1="420" y1="335" x2="450" y2="335" class="chain-arrow"/>
121
+ <line x1="550" y1="335" x2="580" y2="335" class="chain-arrow"/>
122
+
123
+ <!-- Builder state progression -->
124
+ <text x="120" y="365" class="small-label">Start</text>
125
+ <text x="240" y="365" class="small-label">Builder</text>
126
+ <text x="365" y="365" class="small-label">+ from</text>
127
+ <text x="500" y="365" class="small-label">+ to</text>
128
+ <text x="630" y="365" class="small-label">Execute</text>
129
+
130
+ <text x="120" y="380" class="comment">Initial state</text>
131
+ <text x="240" y="380" class="comment">Pattern: *.*.*</text>
132
+ <text x="365" y="380" class="comment">*.api.*</text>
133
+ <text x="500" y="380" class="comment">*.api.db</text>
134
+ <text x="630" y="380" class="comment">Subscribe!</text>
135
+
136
+ <!-- Advanced Examples -->
137
+ <rect x="50" y="460" width="800" height="120" class="box"/>
138
+ <text x="450" y="485" class="label">Advanced Fluent API Patterns</text>
139
+
140
+ <!-- Multi-condition example -->
141
+ <text x="70" y="510" class="small-label">Multi-condition Routing:</text>
142
+ <text x="70" y="530" class="code-label">transport.where.from('monitoring').to('admin-panel').type('AdminAlert').subscribe</text>
143
+ <text x="70" y="545" class="comment"># Matches: adminalert.monitoring.admin-panel</text>
144
+
145
+ <!-- Broadcasting example -->
146
+ <text x="70" y="565" class="small-label">Broadcasting Pattern:</text>
147
+ <text x="70" y="585" class="code-label">transport.where.to('broadcast').subscribe</text>
148
+ <text x="70" y="560" class="comment"># Matches all broadcast messages: *.*.broadcast</text>
149
+ </svg>