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.
- checksums.yaml +4 -4
- data/.github/workflows/deploy-github-pages.yml +38 -0
- data/.gitignore +5 -0
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +35 -4
- data/README.md +169 -71
- data/Rakefile +29 -4
- data/docs/assets/images/ddq_architecture.svg +130 -0
- data/docs/assets/images/dlq_architecture.svg +115 -0
- data/docs/assets/images/enhanced-dual-publishing.svg +136 -0
- data/docs/assets/images/enhanced-fluent-api.svg +149 -0
- data/docs/assets/images/enhanced-microservices-routing.svg +115 -0
- data/docs/assets/images/enhanced-pattern-matching.svg +107 -0
- data/docs/assets/images/fluent-api-demo.svg +59 -0
- data/docs/assets/images/performance-comparison.svg +161 -0
- data/docs/assets/images/redis-basic-architecture.svg +53 -0
- data/docs/assets/images/redis-enhanced-architecture.svg +88 -0
- data/docs/assets/images/redis-queue-architecture.svg +101 -0
- data/docs/assets/images/smart_message.jpg +0 -0
- data/docs/assets/images/smart_message_walking.jpg +0 -0
- data/docs/assets/images/smartmessage_architecture_overview.svg +173 -0
- data/docs/assets/images/transport-comparison-matrix.svg +171 -0
- data/docs/assets/javascripts/mathjax.js +17 -0
- data/docs/assets/stylesheets/extra.css +51 -0
- data/docs/{addressing.md → core-concepts/addressing.md} +5 -7
- data/docs/{architecture.md → core-concepts/architecture.md} +78 -138
- data/docs/{dispatcher.md → core-concepts/dispatcher.md} +21 -21
- data/docs/{message_filtering.md → core-concepts/message-filtering.md} +2 -3
- data/docs/{message_processing.md → core-concepts/message-processing.md} +17 -17
- data/docs/{troubleshooting.md → development/troubleshooting.md} +7 -7
- data/docs/{examples.md → getting-started/examples.md} +115 -89
- data/docs/{getting-started.md → getting-started/quick-start.md} +47 -18
- data/docs/guides/redis-queue-getting-started.md +697 -0
- data/docs/guides/redis-queue-patterns.md +889 -0
- data/docs/guides/redis-queue-production.md +1091 -0
- data/docs/index.md +64 -0
- data/docs/{dead_letter_queue.md → reference/dead-letter-queue.md} +2 -3
- data/docs/{logging.md → reference/logging.md} +1 -1
- data/docs/{message_deduplication.md → reference/message-deduplication.md} +1 -0
- data/docs/{proc_handlers_summary.md → reference/proc-handlers.md} +7 -6
- data/docs/{serializers.md → reference/serializers.md} +3 -5
- data/docs/{transports.md → reference/transports.md} +133 -11
- data/docs/transports/memory-transport.md +374 -0
- data/docs/transports/redis-enhanced-transport.md +524 -0
- data/docs/transports/redis-queue-transport.md +1304 -0
- data/docs/transports/redis-transport-comparison.md +496 -0
- data/docs/transports/redis-transport.md +509 -0
- data/examples/README.md +98 -5
- data/examples/city_scenario/911_emergency_call_flow.svg +99 -0
- data/examples/city_scenario/README.md +515 -0
- data/examples/city_scenario/ai_visitor_intelligence_flow.svg +108 -0
- data/examples/city_scenario/citizen.rb +195 -0
- data/examples/city_scenario/city_diagram.svg +125 -0
- data/examples/city_scenario/common/health_monitor.rb +80 -0
- data/examples/city_scenario/common/logger.rb +30 -0
- data/examples/city_scenario/emergency_dispatch_center.rb +270 -0
- data/examples/city_scenario/fire_department.rb +446 -0
- data/examples/city_scenario/fire_emergency_flow.svg +95 -0
- data/examples/city_scenario/health_department.rb +100 -0
- data/examples/city_scenario/health_monitoring_system.svg +130 -0
- data/examples/city_scenario/house.rb +244 -0
- data/examples/city_scenario/local_bank.rb +217 -0
- data/examples/city_scenario/messages/emergency_911_message.rb +81 -0
- data/examples/city_scenario/messages/emergency_resolved_message.rb +43 -0
- data/examples/city_scenario/messages/fire_dispatch_message.rb +43 -0
- data/examples/city_scenario/messages/fire_emergency_message.rb +45 -0
- data/examples/city_scenario/messages/health_check_message.rb +22 -0
- data/examples/city_scenario/messages/health_status_message.rb +35 -0
- data/examples/city_scenario/messages/police_dispatch_message.rb +46 -0
- data/examples/city_scenario/messages/silent_alarm_message.rb +38 -0
- data/examples/city_scenario/police_department.rb +316 -0
- data/examples/city_scenario/redis_monitor.rb +129 -0
- data/examples/city_scenario/redis_stats.rb +743 -0
- data/examples/city_scenario/room_for_improvement.md +240 -0
- data/examples/city_scenario/security_emergency_flow.svg +95 -0
- data/examples/city_scenario/service_internal_architecture.svg +154 -0
- data/examples/city_scenario/smart_message_ai_agent.rb +364 -0
- data/examples/city_scenario/start_demo.sh +236 -0
- data/examples/city_scenario/stop_demo.sh +106 -0
- data/examples/city_scenario/visitor.rb +631 -0
- data/examples/{10_message_deduplication.rb → memory/01_message_deduplication_demo.rb} +1 -1
- data/examples/{09_dead_letter_queue_demo.rb → memory/02_dead_letter_queue_demo.rb} +13 -40
- data/examples/{01_point_to_point_orders.rb → memory/03_point_to_point_orders.rb} +1 -1
- data/examples/{02_publish_subscribe_events.rb → memory/04_publish_subscribe_events.rb} +2 -2
- data/examples/{03_many_to_many_chat.rb → memory/05_many_to_many_chat.rb} +4 -4
- data/examples/{show_me.rb → memory/06_pretty_print_demo.rb} +1 -1
- data/examples/{05_proc_handlers.rb → memory/07_proc_handlers_demo.rb} +2 -2
- data/examples/{06_custom_logger_example.rb → memory/08_custom_logger_demo.rb} +17 -14
- data/examples/{07_error_handling_scenarios.rb → memory/09_error_handling_demo.rb} +4 -4
- data/examples/{08_entity_addressing_basic.rb → memory/10_entity_addressing_basic.rb} +8 -8
- data/examples/{08_entity_addressing_with_filtering.rb → memory/11_entity_addressing_with_filtering.rb} +6 -6
- data/examples/{09_regex_filtering_microservices.rb → memory/12_regex_filtering_microservices.rb} +2 -2
- data/examples/{10_header_block_configuration.rb → memory/13_header_block_configuration.rb} +6 -6
- data/examples/{11_global_configuration_example.rb → memory/14_global_configuration_demo.rb} +19 -8
- data/examples/{show_logger.rb → memory/15_logger_demo.rb} +1 -1
- data/examples/memory/README.md +163 -0
- data/examples/memory/memory_transport_architecture.svg +90 -0
- data/examples/memory/point_to_point_pattern.svg +94 -0
- data/examples/memory/publish_subscribe_pattern.svg +125 -0
- data/examples/{04_redis_smart_home_iot.rb → redis/01_smart_home_iot_demo.rb} +5 -5
- data/examples/redis/README.md +230 -0
- data/examples/redis/alert_system_flow.svg +127 -0
- data/examples/redis/dashboard_status_flow.svg +107 -0
- data/examples/redis/device_command_flow.svg +113 -0
- data/examples/redis/redis_transport_architecture.svg +115 -0
- data/examples/{smart_home_iot_dataflow.md → redis/smart_home_iot_dataflow.md} +4 -116
- data/examples/redis/smart_home_system_architecture.svg +133 -0
- data/examples/redis_enhanced/README.md +319 -0
- data/examples/redis_enhanced/enhanced_01_basic_patterns.rb +233 -0
- data/examples/redis_enhanced/enhanced_02_fluent_api.rb +331 -0
- data/examples/redis_enhanced/enhanced_03_dual_publishing.rb +281 -0
- data/examples/redis_enhanced/enhanced_04_advanced_routing.rb +419 -0
- data/examples/redis_queue/01_basic_messaging.rb +221 -0
- data/examples/redis_queue/01_comprehensive_examples.rb +508 -0
- data/examples/redis_queue/02_pattern_routing.rb +405 -0
- data/examples/redis_queue/03_fluent_api.rb +422 -0
- data/examples/redis_queue/04_load_balancing.rb +486 -0
- data/examples/redis_queue/05_microservices.rb +735 -0
- data/examples/redis_queue/06_emergency_alerts.rb +777 -0
- data/examples/redis_queue/07_queue_management.rb +587 -0
- data/examples/redis_queue/README.md +366 -0
- data/examples/redis_queue/enhanced_01_basic_patterns.rb +233 -0
- data/examples/redis_queue/enhanced_02_fluent_api.rb +331 -0
- data/examples/redis_queue/enhanced_03_dual_publishing.rb +281 -0
- data/examples/redis_queue/enhanced_04_advanced_routing.rb +419 -0
- data/examples/redis_queue/redis_queue_architecture.svg +148 -0
- data/ideas/README.md +41 -0
- data/ideas/agents.md +1001 -0
- data/ideas/database_transport.md +980 -0
- data/ideas/improvement.md +359 -0
- data/ideas/meshage.md +1788 -0
- data/ideas/message_discovery.md +178 -0
- data/ideas/message_schema.md +1381 -0
- data/lib/smart_message/.idea/.gitignore +8 -0
- data/lib/smart_message/.idea/markdown.xml +6 -0
- data/lib/smart_message/.idea/misc.xml +4 -0
- data/lib/smart_message/.idea/modules.xml +8 -0
- data/lib/smart_message/.idea/smart_message.iml +16 -0
- data/lib/smart_message/.idea/vcs.xml +6 -0
- data/lib/smart_message/addressing.rb +15 -0
- data/lib/smart_message/base.rb +0 -2
- data/lib/smart_message/configuration.rb +1 -1
- data/lib/smart_message/logger.rb +15 -4
- data/lib/smart_message/plugins.rb +5 -2
- data/lib/smart_message/serializer.rb +14 -0
- data/lib/smart_message/transport/redis_enhanced_transport.rb +399 -0
- data/lib/smart_message/transport/redis_queue_transport.rb +555 -0
- data/lib/smart_message/transport/registry.rb +1 -0
- data/lib/smart_message/transport.rb +34 -1
- data/lib/smart_message/version.rb +1 -1
- data/lib/smart_message.rb +5 -52
- data/mkdocs.yml +184 -0
- data/p2p_plan.md +326 -0
- data/p2p_roadmap.md +287 -0
- data/smart_message.gemspec +2 -0
- data/smart_message.svg +51 -0
- metadata +170 -44
- data/docs/README.md +0 -57
- data/examples/dead_letters.jsonl +0 -12
- data/examples/temp.txt +0 -94
- data/examples/tmux_chat/README.md +0 -283
- data/examples/tmux_chat/bot_agent.rb +0 -278
- data/examples/tmux_chat/human_agent.rb +0 -199
- data/examples/tmux_chat/room_monitor.rb +0 -160
- data/examples/tmux_chat/shared_chat_system.rb +0 -328
- data/examples/tmux_chat/start_chat_demo.sh +0 -190
- data/examples/tmux_chat/stop_chat_demo.sh +0 -22
- /data/docs/{properties.md → core-concepts/properties.md} +0 -0
- /data/docs/{ideas_to_think_about.md → development/ideas.md} +0 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
<svg width="900" height="400" 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
|
+
.box { fill: #21262d; stroke: #30363d; stroke-width: 2; rx: 8; }
|
8
|
+
.highlight-box { fill: #0d1117; stroke: #f85149; stroke-width: 2; rx: 8; }
|
9
|
+
.queue-box { fill: #0d1117; stroke: #56d364; stroke-width: 2; rx: 8; }
|
10
|
+
.async-box { fill: #161b22; stroke: #a5a5ff; stroke-width: 2; rx: 6; }
|
11
|
+
.consumer-box { fill: #161b22; stroke: #ffa657; stroke-width: 2; rx: 6; }
|
12
|
+
.arrow { stroke: #58a6ff; stroke-width: 2; fill: none; marker-end: url(#arrowhead); }
|
13
|
+
.queue-flow { stroke: #56d364; stroke-width: 3; fill: none; marker-end: url(#arrowhead-green); }
|
14
|
+
.async-flow { stroke: #a5a5ff; stroke-width: 2; fill: none; marker-end: url(#arrowhead-purple); }
|
15
|
+
</style>
|
16
|
+
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
17
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="#58a6ff" />
|
18
|
+
</marker>
|
19
|
+
<marker id="arrowhead-green" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
20
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="#56d364" />
|
21
|
+
</marker>
|
22
|
+
<marker id="arrowhead-purple" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
|
23
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="#a5a5ff" />
|
24
|
+
</marker>
|
25
|
+
</defs>
|
26
|
+
|
27
|
+
<!-- Title -->
|
28
|
+
<text x="450" y="30" class="title">Redis Queue Transport Architecture</text>
|
29
|
+
|
30
|
+
<!-- Publisher -->
|
31
|
+
<rect x="50" y="80" width="120" height="80" class="box"/>
|
32
|
+
<text x="110" y="105" class="label">Publisher</text>
|
33
|
+
<text x="110" y="125" class="small-label">OrderMessage</text>
|
34
|
+
<text x="110" y="140" class="small-label">Async context</text>
|
35
|
+
<text x="110" y="155" class="small-label">Fiber-based</text>
|
36
|
+
|
37
|
+
<!-- Routing Engine -->
|
38
|
+
<rect x="220" y="80" width="140" height="80" class="highlight-box"/>
|
39
|
+
<text x="290" y="105" class="label">Routing Engine</text>
|
40
|
+
<text x="290" y="125" class="small-label">Pattern matching:</text>
|
41
|
+
<text x="290" y="140" class="small-label">#.*.payment</text>
|
42
|
+
<text x="290" y="155" class="small-label">order.#.*.*</text>
|
43
|
+
|
44
|
+
<!-- Redis Lists (Queues) -->
|
45
|
+
<rect x="410" y="60" width="130" height="50" class="queue-box"/>
|
46
|
+
<text x="475" y="80" class="small-label">Redis List (FIFO)</text>
|
47
|
+
<text x="475" y="95" class="small-label">LPUSH/BRPOP</text>
|
48
|
+
|
49
|
+
<rect x="410" y="120" width="130" height="50" class="queue-box"/>
|
50
|
+
<text x="475" y="140" class="small-label">Persistent Queue</text>
|
51
|
+
<text x="475" y="155" class="small-label">Message ordering</text>
|
52
|
+
|
53
|
+
<!-- Consumer Group -->
|
54
|
+
<rect x="590" y="80" width="140" height="80" class="consumer-box"/>
|
55
|
+
<text x="660" y="105" class="label">Consumer Group</text>
|
56
|
+
<text x="660" y="125" class="small-label">"workers"</text>
|
57
|
+
<text x="660" y="140" class="small-label">Load balancing</text>
|
58
|
+
<text x="660" y="155" class="small-label">Fault tolerance</text>
|
59
|
+
|
60
|
+
<!-- Async Workers -->
|
61
|
+
<rect x="780" y="60" width="100" height="40" class="async-box"/>
|
62
|
+
<text x="830" y="80" class="small-label">Worker 1</text>
|
63
|
+
<text x="830" y="95" class="small-label">Fiber</text>
|
64
|
+
|
65
|
+
<rect x="780" y="110" width="100" height="40" class="async-box"/>
|
66
|
+
<text x="830" y="130" class="small-label">Worker 2</text>
|
67
|
+
<text x="830" y="145" class="small-label">Fiber</text>
|
68
|
+
|
69
|
+
<rect x="780" y="160" width="100" height="40" class="async-box"/>
|
70
|
+
<text x="830" y="180" class="small-label">Worker N</text>
|
71
|
+
<text x="830" y="195" class="small-label">Fiber</text>
|
72
|
+
|
73
|
+
<!-- Flow Arrows -->
|
74
|
+
<line x1="170" y1="120" x2="220" y2="120" class="arrow"/>
|
75
|
+
<line x1="360" y1="100" x2="410" y2="85" class="queue-flow"/>
|
76
|
+
<line x1="360" y1="140" x2="410" y2="145" class="queue-flow"/>
|
77
|
+
<line x1="540" y1="120" x2="590" y2="120" class="queue-flow"/>
|
78
|
+
<line x1="730" y1="100" x2="780" y2="80" class="async-flow"/>
|
79
|
+
<line x1="730" y1="120" x2="780" y2="130" class="async-flow"/>
|
80
|
+
<line x1="730" y1="140" x2="780" y2="180" class="async-flow"/>
|
81
|
+
|
82
|
+
<!-- Performance Stats -->
|
83
|
+
<rect x="50" y="220" width="800" height="120" class="async-box"/>
|
84
|
+
<text x="450" y="245" class="label">Performance & Features</text>
|
85
|
+
|
86
|
+
<text x="200" y="270" class="small-label">Latency: ~0.5ms</text>
|
87
|
+
<text x="200" y="285" class="small-label">Throughput: 100K+ msg/sec</text>
|
88
|
+
<text x="200" y="300" class="small-label">10x faster than RabbitMQ</text>
|
89
|
+
|
90
|
+
<text x="450" y="270" class="small-label">Concurrent Consumers: 1000+</text>
|
91
|
+
<text x="450" y="285" class="small-label">Memory per Consumer: ~2KB</text>
|
92
|
+
<text x="450" y="300" class="small-label">1000x less than RabbitMQ</text>
|
93
|
+
|
94
|
+
<text x="700" y="270" class="small-label">• Message Persistence</text>
|
95
|
+
<text x="700" y="285" class="small-label">• Load Balancing</text>
|
96
|
+
<text x="700" y="300" class="small-label">• Dead Letter Queues</text>
|
97
|
+
|
98
|
+
<!-- Key Benefits -->
|
99
|
+
<text x="450" y="360" class="label">Enterprise messaging with Redis performance: RabbitMQ features + 10x speed + Async scalability</text>
|
100
|
+
<text x="450" y="380" class="small-label">Perfect for production systems requiring message persistence, load balancing, and maximum throughput</text>
|
101
|
+
</svg>
|
Binary file
|
Binary file
|
@@ -0,0 +1,173 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="900" height="700" viewBox="0 0 900 700" xmlns="http://www.w3.org/2000/svg">
|
3
|
+
<defs>
|
4
|
+
<style>
|
5
|
+
.bg { fill: transparent; }
|
6
|
+
.core-group { fill: #1a2a3a; stroke: #4a9eff; stroke-width: 2; rx: 10; }
|
7
|
+
.plugin-group { fill: #2a1a3a; stroke: #aa4aff; stroke-width: 2; rx: 10; }
|
8
|
+
.processing-group { fill: #1a3a2a; stroke: #4aff4a; stroke-width: 2; rx: 10; }
|
9
|
+
.reliability-group { fill: #3a1a1a; stroke: #ff4a4a; stroke-width: 2; rx: 10; }
|
10
|
+
.monitoring-group { fill: #3a3a1a; stroke: #ffaa4a; stroke-width: 2; rx: 10; }
|
11
|
+
.component { fill: #2a2a2a; stroke: #ffffff; stroke-width: 1; rx: 5; }
|
12
|
+
.flow { stroke: #4a9eff; stroke-width: 2; fill: none; marker-end: url(#arrowhead-blue); }
|
13
|
+
.plugin-flow { stroke: #aa4aff; stroke-width: 2; fill: none; marker-end: url(#arrowhead-purple); }
|
14
|
+
.process-flow { stroke: #4aff4a; stroke-width: 2; fill: none; marker-end: url(#arrowhead-green); }
|
15
|
+
.reliability-flow { stroke: #ff4a4a; stroke-width: 2; fill: none; marker-end: url(#arrowhead-red); }
|
16
|
+
.monitor-flow { stroke: #ffaa4a; stroke-width: 2; fill: none; stroke-dasharray: 4,4; }
|
17
|
+
.text { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 11px; }
|
18
|
+
.title { fill: #4a9eff; font-family: 'Arial', sans-serif; font-size: 18px; font-weight: bold; }
|
19
|
+
.group-title { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 13px; font-weight: bold; }
|
20
|
+
.component-title { fill: #ffffff; font-family: 'Arial', sans-serif; font-size: 12px; font-weight: bold; }
|
21
|
+
</style>
|
22
|
+
<marker id="arrowhead-blue" markerWidth="8" markerHeight="6"
|
23
|
+
refX="8" refY="3" orient="auto">
|
24
|
+
<polygon points="0 0, 8 3, 0 6" fill="#4a9eff" />
|
25
|
+
</marker>
|
26
|
+
<marker id="arrowhead-purple" markerWidth="8" markerHeight="6"
|
27
|
+
refX="8" refY="3" orient="auto">
|
28
|
+
<polygon points="0 0, 8 3, 0 6" fill="#aa4aff" />
|
29
|
+
</marker>
|
30
|
+
<marker id="arrowhead-green" markerWidth="8" markerHeight="6"
|
31
|
+
refX="8" refY="3" orient="auto">
|
32
|
+
<polygon points="0 0, 8 3, 0 6" fill="#4aff4a" />
|
33
|
+
</marker>
|
34
|
+
<marker id="arrowhead-red" markerWidth="8" markerHeight="6"
|
35
|
+
refX="8" refY="3" orient="auto">
|
36
|
+
<polygon points="0 0, 8 3, 0 6" fill="#ff4a4a" />
|
37
|
+
</marker>
|
38
|
+
</defs>
|
39
|
+
|
40
|
+
<!-- Background -->
|
41
|
+
<rect class="bg" width="900" height="700"/>
|
42
|
+
|
43
|
+
<!-- Title -->
|
44
|
+
<text x="450" y="25" text-anchor="middle" class="title">SmartMessage Architecture Overview</text>
|
45
|
+
|
46
|
+
<!-- SmartMessage Core Group -->
|
47
|
+
<rect x="50" y="60" width="250" height="180" class="core-group"/>
|
48
|
+
<text x="175" y="80" text-anchor="middle" class="group-title">SmartMessage Core</text>
|
49
|
+
|
50
|
+
<rect x="70" y="95" width="210" height="35" class="component"/>
|
51
|
+
<text x="175" y="115" text-anchor="middle" class="component-title">SmartMessage::Base</text>
|
52
|
+
|
53
|
+
<rect x="70" y="140" width="100" height="45" class="component"/>
|
54
|
+
<text x="120" y="157" text-anchor="middle" class="component-title">Message Header</text>
|
55
|
+
<text x="120" y="172" text-anchor="middle" class="text">• UUID</text>
|
56
|
+
<text x="120" y="182" text-anchor="middle" class="text">• Timestamps • Addressing</text>
|
57
|
+
|
58
|
+
<rect x="180" y="140" width="100" height="45" class="component"/>
|
59
|
+
<text x="230" y="157" text-anchor="middle" class="component-title">Message Properties</text>
|
60
|
+
<text x="230" y="172" text-anchor="middle" class="text">• Business Data</text>
|
61
|
+
<text x="230" y="182" text-anchor="middle" class="text">• Validation • Versioning</text>
|
62
|
+
|
63
|
+
<!-- Plugin System Group -->
|
64
|
+
<rect x="350" y="60" width="200" height="180" class="plugin-group"/>
|
65
|
+
<text x="450" y="80" text-anchor="middle" class="group-title">Plugin System</text>
|
66
|
+
|
67
|
+
<rect x="370" y="95" width="160" height="40" class="component"/>
|
68
|
+
<text x="450" y="110" text-anchor="middle" class="component-title">Transport Plugin</text>
|
69
|
+
<text x="450" y="122" text-anchor="middle" class="text">• publish • subscribe</text>
|
70
|
+
<text x="450" y="132" text-anchor="middle" class="text">• Memory/Redis/STDOUT</text>
|
71
|
+
|
72
|
+
<rect x="370" y="145" width="160" height="40" class="component"/>
|
73
|
+
<text x="450" y="160" text-anchor="middle" class="component-title">Serializer Plugin</text>
|
74
|
+
<text x="450" y="172" text-anchor="middle" class="text">• encode • decode</text>
|
75
|
+
<text x="450" y="182" text-anchor="middle" class="text">• JSON/Custom</text>
|
76
|
+
|
77
|
+
<rect x="370" y="195" width="160" height="40" class="component"/>
|
78
|
+
<text x="450" y="210" text-anchor="middle" class="component-title">Logger Plugin</text>
|
79
|
+
<text x="450" y="222" text-anchor="middle" class="text">• Structured logging</text>
|
80
|
+
<text x="450" y="232" text-anchor="middle" class="text">• Multiple outputs • Colorization</text>
|
81
|
+
|
82
|
+
<!-- Message Processing Group -->
|
83
|
+
<rect x="50" y="260" width="500" height="180" class="processing-group"/>
|
84
|
+
<text x="300" y="280" text-anchor="middle" class="group-title">Message Processing</text>
|
85
|
+
|
86
|
+
<rect x="70" y="295" width="140" height="50" class="component"/>
|
87
|
+
<text x="140" y="315" text-anchor="middle" class="component-title">Dispatcher</text>
|
88
|
+
<text x="140" y="327" text-anchor="middle" class="text">• Route messages • Thread pool</text>
|
89
|
+
<text x="140" y="337" text-anchor="middle" class="text">• Subscriptions • DDQ management</text>
|
90
|
+
|
91
|
+
<rect x="230" y="295" width="140" height="50" class="component"/>
|
92
|
+
<text x="300" y="315" text-anchor="middle" class="component-title">Deduplication Queue</text>
|
93
|
+
<text x="300" y="327" text-anchor="middle" class="text">• Handler-scoped • Memory/Redis</text>
|
94
|
+
<text x="300" y="337" text-anchor="middle" class="text">• O(1) performance • Circular buffer</text>
|
95
|
+
|
96
|
+
<rect x="390" y="295" width="140" height="50" class="component"/>
|
97
|
+
<text x="460" y="315" text-anchor="middle" class="component-title">Message Handlers</text>
|
98
|
+
<text x="460" y="327" text-anchor="middle" class="text">• Default handler • Block handlers</text>
|
99
|
+
<text x="460" y="337" text-anchor="middle" class="text">• Proc handlers • Method handlers</text>
|
100
|
+
|
101
|
+
<rect x="70" y="365" width="140" height="50" class="component"/>
|
102
|
+
<text x="140" y="385" text-anchor="middle" class="component-title">Statistics</text>
|
103
|
+
<text x="140" y="397" text-anchor="middle" class="text">• Message counts • Processing metrics</text>
|
104
|
+
<text x="140" y="407" text-anchor="middle" class="text">• Thread pool status</text>
|
105
|
+
|
106
|
+
<rect x="230" y="365" width="140" height="50" class="component"/>
|
107
|
+
<text x="300" y="385" text-anchor="middle" class="component-title">Message Filtering</text>
|
108
|
+
<text x="300" y="397" text-anchor="middle" class="text">• Entity-aware routing</text>
|
109
|
+
<text x="300" y="407" text-anchor="middle" class="text">• Regex patterns • Broadcast handling</text>
|
110
|
+
|
111
|
+
<!-- Reliability Layer Group -->
|
112
|
+
<rect x="600" y="60" width="250" height="180" class="reliability-group"/>
|
113
|
+
<text x="725" y="80" text-anchor="middle" class="group-title">Reliability Layer</text>
|
114
|
+
|
115
|
+
<rect x="620" y="95" width="210" height="50" class="component"/>
|
116
|
+
<text x="725" y="115" text-anchor="middle" class="component-title">Circuit Breaker</text>
|
117
|
+
<text x="725" y="127" text-anchor="middle" class="text">• Failure thresholds • Automatic fallback</text>
|
118
|
+
<text x="725" y="137" text-anchor="middle" class="text">• Recovery detection</text>
|
119
|
+
|
120
|
+
<rect x="620" y="165" width="210" height="50" class="component"/>
|
121
|
+
<text x="725" y="185" text-anchor="middle" class="component-title">Dead Letter Queue</text>
|
122
|
+
<text x="725" y="197" text-anchor="middle" class="text">• Failed messages • Replay mechanism</text>
|
123
|
+
<text x="725" y="207" text-anchor="middle" class="text">• JSON Lines format</text>
|
124
|
+
|
125
|
+
<!-- Core connections -->
|
126
|
+
<path d="M 175 130 L 175 140" class="flow"/>
|
127
|
+
<path d="M 175 130 L 230 140" class="flow"/>
|
128
|
+
<path d="M 175 130 L 120 140" class="flow"/>
|
129
|
+
|
130
|
+
<!-- Plugin connections -->
|
131
|
+
<path d="M 300 112 L 370 115" class="plugin-flow"/>
|
132
|
+
<path d="M 300 112 L 370 165" class="plugin-flow"/>
|
133
|
+
<path d="M 300 112 L 370 215" class="plugin-flow"/>
|
134
|
+
|
135
|
+
<!-- Transport to Processing -->
|
136
|
+
<path d="M 450 135 L 450 250 L 140 295" class="process-flow"/>
|
137
|
+
|
138
|
+
<!-- Processing internal flows -->
|
139
|
+
<path d="M 210 320 L 230 320" class="process-flow"/>
|
140
|
+
<path d="M 370 320 L 390 320" class="process-flow"/>
|
141
|
+
<path d="M 140 345 L 140 365" class="process-flow"/>
|
142
|
+
<path d="M 300 345 L 300 365" class="process-flow"/>
|
143
|
+
|
144
|
+
<!-- Reliability connections -->
|
145
|
+
<path d="M 550 115 L 620 120" class="reliability-flow"/>
|
146
|
+
<path d="M 725 145 L 725 165" class="reliability-flow"/>
|
147
|
+
|
148
|
+
<!-- Monitoring connections (dashed)-->
|
149
|
+
<path d="M 300 345 L 140 365" class="monitor-flow"/>
|
150
|
+
<path d="M 460 345 L 140 365" class="monitor-flow"/>
|
151
|
+
|
152
|
+
<!-- Legend -->
|
153
|
+
<rect x="600" y="480" width="280" height="200" fill="#1a1a1a" stroke="#4a9eff" rx="8"/>
|
154
|
+
<text x="740" y="505" text-anchor="middle" class="group-title">Component Legend</text>
|
155
|
+
|
156
|
+
<rect x="620" y="520" width="15" height="10" class="core-group"/>
|
157
|
+
<text x="645" y="530" class="text">SmartMessage Core Components</text>
|
158
|
+
|
159
|
+
<rect x="620" y="540" width="15" height="10" class="plugin-group"/>
|
160
|
+
<text x="645" y="550" class="text">Plugin System Architecture</text>
|
161
|
+
|
162
|
+
<rect x="620" y="560" width="15" height="10" class="processing-group"/>
|
163
|
+
<text x="645" y="570" class="text">Message Processing Engine</text>
|
164
|
+
|
165
|
+
<rect x="620" y="580" width="15" height="10" class="reliability-group"/>
|
166
|
+
<text x="645" y="590" class="text">Reliability & Fault Tolerance</text>
|
167
|
+
|
168
|
+
<line x1="620" y1="610" x2="635" y2="610" class="monitor-flow"/>
|
169
|
+
<text x="645" y="615" class="text">Monitoring & Statistics</text>
|
170
|
+
|
171
|
+
<text x="740" y="645" text-anchor="middle" class="text">Dark Theme Architecture Diagram</text>
|
172
|
+
<text x="740" y="660" text-anchor="middle" class="text">SmartMessage Framework v1.0</text>
|
173
|
+
</svg>
|
@@ -0,0 +1,171 @@
|
|
1
|
+
<svg width="1000" height="600" xmlns="http://www.w3.org/2000/svg" style="background: transparent;">
|
2
|
+
<defs>
|
3
|
+
<style>
|
4
|
+
.title { font: bold 20px sans-serif; fill: #e1e5e9; text-anchor: middle; }
|
5
|
+
.header { font: bold 16px sans-serif; fill: #c9d1d9; text-anchor: middle; }
|
6
|
+
.label { font: 14px sans-serif; fill: #c9d1d9; }
|
7
|
+
.small-label { font: 12px sans-serif; fill: #8b949e; }
|
8
|
+
.feature-label { font: 14px sans-serif; fill: #f0f6fc; }
|
9
|
+
.yes { fill: #56d364; font: bold 14px sans-serif; text-anchor: middle; }
|
10
|
+
.no { fill: #f85149; font: bold 14px sans-serif; text-anchor: middle; }
|
11
|
+
.partial { fill: #ffa657; font: bold 14px sans-serif; text-anchor: middle; }
|
12
|
+
.value { fill: #a5a5ff; font: 14px sans-serif; text-anchor: middle; }
|
13
|
+
.table-border { fill: none; stroke: #30363d; stroke-width: 1; }
|
14
|
+
.header-bg { fill: #161b22; stroke: #30363d; stroke-width: 1; }
|
15
|
+
.row-bg-1 { fill: #0d1117; stroke: #21262d; stroke-width: 1; }
|
16
|
+
.row-bg-2 { fill: #161b22; stroke: #21262d; stroke-width: 1; }
|
17
|
+
.basic-col { fill: #21262d; stroke: #30363d; stroke-width: 1; }
|
18
|
+
.enhanced-col { fill: #1a1d2e; stroke: #a5a5ff; stroke-width: 1; }
|
19
|
+
.queue-col { fill: #1a2e1a; stroke: #56d364; stroke-width: 1; }
|
20
|
+
</style>
|
21
|
+
</defs>
|
22
|
+
|
23
|
+
<!-- Title -->
|
24
|
+
<text x="500" y="30" class="title">Redis Transport Feature Comparison</text>
|
25
|
+
|
26
|
+
<!-- Table Headers -->
|
27
|
+
<rect x="50" y="60" width="250" height="40" class="header-bg"/>
|
28
|
+
<rect x="300" y="60" width="200" height="40" class="basic-col"/>
|
29
|
+
<rect x="500" y="60" width="200" height="40" class="enhanced-col"/>
|
30
|
+
<rect x="700" y="60" width="200" height="40" class="queue-col"/>
|
31
|
+
|
32
|
+
<text x="175" y="85" class="header">Feature</text>
|
33
|
+
<text x="400" y="85" class="header">Basic Redis</text>
|
34
|
+
<text x="600" y="85" class="header">Enhanced Redis</text>
|
35
|
+
<text x="800" y="85" class="header">Redis Queue</text>
|
36
|
+
|
37
|
+
<!-- Feature Rows -->
|
38
|
+
<g id="row1">
|
39
|
+
<rect x="50" y="100" width="250" height="30" class="row-bg-1"/>
|
40
|
+
<rect x="300" y="100" width="200" height="30" class="row-bg-1"/>
|
41
|
+
<rect x="500" y="100" width="200" height="30" class="row-bg-1"/>
|
42
|
+
<rect x="700" y="100" width="200" height="30" class="row-bg-1"/>
|
43
|
+
<text x="60" y="120" class="feature-label">Message Persistence</text>
|
44
|
+
<text x="400" y="120" class="no">✗ No</text>
|
45
|
+
<text x="600" y="120" class="no">✗ No</text>
|
46
|
+
<text x="800" y="120" class="yes">✓ Yes</text>
|
47
|
+
</g>
|
48
|
+
|
49
|
+
<g id="row2">
|
50
|
+
<rect x="50" y="130" width="250" height="30" class="row-bg-2"/>
|
51
|
+
<rect x="300" y="130" width="200" height="30" class="row-bg-2"/>
|
52
|
+
<rect x="500" y="130" width="200" height="30" class="row-bg-2"/>
|
53
|
+
<rect x="700" y="130" width="200" height="30" class="row-bg-2"/>
|
54
|
+
<text x="60" y="150" class="feature-label">Pattern Matching</text>
|
55
|
+
<text x="400" y="150" class="no">✗ None</text>
|
56
|
+
<text x="600" y="150" class="yes">✓ Wildcards</text>
|
57
|
+
<text x="800" y="150" class="yes">✓ RabbitMQ-style</text>
|
58
|
+
</g>
|
59
|
+
|
60
|
+
<g id="row3">
|
61
|
+
<rect x="50" y="160" width="250" height="30" class="row-bg-1"/>
|
62
|
+
<rect x="300" y="160" width="200" height="30" class="row-bg-1"/>
|
63
|
+
<rect x="500" y="160" width="200" height="30" class="row-bg-1"/>
|
64
|
+
<rect x="700" y="160" width="200" height="30" class="row-bg-1"/>
|
65
|
+
<text x="60" y="180" class="feature-label">Load Balancing</text>
|
66
|
+
<text x="400" y="180" class="no">✗ No</text>
|
67
|
+
<text x="600" y="180" class="no">✗ No</text>
|
68
|
+
<text x="800" y="180" class="yes">✓ Consumer Groups</text>
|
69
|
+
</g>
|
70
|
+
|
71
|
+
<g id="row4">
|
72
|
+
<rect x="50" y="190" width="250" height="30" class="row-bg-2"/>
|
73
|
+
<rect x="300" y="190" width="200" height="30" class="row-bg-2"/>
|
74
|
+
<rect x="500" y="190" width="200" height="30" class="row-bg-2"/>
|
75
|
+
<rect x="700" y="190" width="200" height="30" class="row-bg-2"/>
|
76
|
+
<text x="60" y="210" class="feature-label">Backwards Compatible</text>
|
77
|
+
<text x="400" y="210" class="value">N/A</text>
|
78
|
+
<text x="600" y="210" class="yes">✓ Dual Publishing</text>
|
79
|
+
<text x="800" y="210" class="no">✗ No</text>
|
80
|
+
</g>
|
81
|
+
|
82
|
+
<g id="row5">
|
83
|
+
<rect x="50" y="220" width="250" height="30" class="row-bg-1"/>
|
84
|
+
<rect x="300" y="220" width="200" height="30" class="row-bg-1"/>
|
85
|
+
<rect x="500" y="220" width="200" height="30" class="row-bg-1"/>
|
86
|
+
<rect x="700" y="220" width="200" height="30" class="row-bg-1"/>
|
87
|
+
<text x="60" y="240" class="feature-label">Fluent API</text>
|
88
|
+
<text x="400" y="240" class="no">✗ No</text>
|
89
|
+
<text x="600" y="240" class="yes">✓ Yes</text>
|
90
|
+
<text x="800" y="240" class="yes">✓ Yes</text>
|
91
|
+
</g>
|
92
|
+
|
93
|
+
<g id="row6">
|
94
|
+
<rect x="50" y="250" width="250" height="30" class="row-bg-2"/>
|
95
|
+
<rect x="300" y="250" width="200" height="30" class="row-bg-2"/>
|
96
|
+
<rect x="500" y="250" width="200" height="30" class="row-bg-2"/>
|
97
|
+
<rect x="700" y="250" width="200" height="30" class="row-bg-2"/>
|
98
|
+
<text x="60" y="270" class="feature-label">Latency</text>
|
99
|
+
<text x="400" y="270" class="value">~1ms</text>
|
100
|
+
<text x="600" y="270" class="value">~1.2ms</text>
|
101
|
+
<text x="800" y="270" class="value">~0.5ms</text>
|
102
|
+
</g>
|
103
|
+
|
104
|
+
<g id="row7">
|
105
|
+
<rect x="50" y="280" width="250" height="30" class="row-bg-1"/>
|
106
|
+
<rect x="300" y="280" width="200" height="30" class="row-bg-1"/>
|
107
|
+
<rect x="500" y="280" width="200" height="30" class="row-bg-1"/>
|
108
|
+
<rect x="700" y="280" width="200" height="30" class="row-bg-1"/>
|
109
|
+
<text x="60" y="300" class="feature-label">Concurrent Consumers</text>
|
110
|
+
<text x="400" y="300" class="value">~100s</text>
|
111
|
+
<text x="600" y="300" class="value">~100s</text>
|
112
|
+
<text x="800" y="300" class="value">~1000s</text>
|
113
|
+
</g>
|
114
|
+
|
115
|
+
<g id="row8">
|
116
|
+
<rect x="50" y="310" width="250" height="30" class="row-bg-2"/>
|
117
|
+
<rect x="300" y="310" width="200" height="30" class="row-bg-2"/>
|
118
|
+
<rect x="500" y="310" width="200" height="30" class="row-bg-2"/>
|
119
|
+
<rect x="700" y="310" width="200" height="30" class="row-bg-2"/>
|
120
|
+
<text x="60" y="330" class="feature-label">Setup Complexity</text>
|
121
|
+
<text x="400" y="330" class="yes">Low</text>
|
122
|
+
<text x="600" y="330" class="partial">Medium</text>
|
123
|
+
<text x="800" y="330" class="no">High</text>
|
124
|
+
</g>
|
125
|
+
|
126
|
+
<g id="row9">
|
127
|
+
<rect x="50" y="340" width="250" height="30" class="row-bg-1"/>
|
128
|
+
<rect x="300" y="340" width="200" height="30" class="row-bg-1"/>
|
129
|
+
<rect x="500" y="340" width="200" height="30" class="row-bg-1"/>
|
130
|
+
<rect x="700" y="340" width="200" height="30" class="row-bg-1"/>
|
131
|
+
<text x="60" y="360" class="feature-label">Memory Overhead</text>
|
132
|
+
<text x="400" y="360" class="yes">Low</text>
|
133
|
+
<text x="600" y="360" class="partial">Medium</text>
|
134
|
+
<text x="800" y="360" class="partial">Medium-High</text>
|
135
|
+
</g>
|
136
|
+
|
137
|
+
<g id="row10">
|
138
|
+
<rect x="50" y="370" width="250" height="30" class="row-bg-2"/>
|
139
|
+
<rect x="300" y="370" width="200" height="30" class="row-bg-2"/>
|
140
|
+
<rect x="500" y="370" width="200" height="30" class="row-bg-2"/>
|
141
|
+
<rect x="700" y="370" width="200" height="30" class="row-bg-2"/>
|
142
|
+
<text x="60" y="390" class="feature-label">Message Ordering</text>
|
143
|
+
<text x="400" y="390" class="no">No guarantees</text>
|
144
|
+
<text x="600" y="390" class="no">No guarantees</text>
|
145
|
+
<text x="800" y="390" class="yes">✓ FIFO</text>
|
146
|
+
</g>
|
147
|
+
|
148
|
+
<!-- Use Case Recommendations -->
|
149
|
+
<text x="500" y="440" class="header">Recommended Use Cases</text>
|
150
|
+
|
151
|
+
<rect x="50" y="460" width="280" height="100" class="basic-col"/>
|
152
|
+
<text x="190" y="480" class="header">Basic Redis</text>
|
153
|
+
<text x="60" y="500" class="small-label">• Simple pub/sub scenarios</text>
|
154
|
+
<text x="60" y="515" class="small-label">• Development/testing</text>
|
155
|
+
<text x="60" y="530" class="small-label">• Legacy compatibility</text>
|
156
|
+
<text x="60" y="545" class="small-label">• Maximum performance</text>
|
157
|
+
|
158
|
+
<rect x="360" y="460" width="280" height="100" class="enhanced-col"/>
|
159
|
+
<text x="500" y="480" class="header">Enhanced Redis</text>
|
160
|
+
<text x="370" y="500" class="small-label">• Microservices architecture</text>
|
161
|
+
<text x="370" y="515" class="small-label">• Pattern-based routing</text>
|
162
|
+
<text x="370" y="530" class="small-label">• Migration scenarios</text>
|
163
|
+
<text x="370" y="545" class="small-label">• Intelligent filtering</text>
|
164
|
+
|
165
|
+
<rect x="670" y="460" width="280" height="100" class="queue-col"/>
|
166
|
+
<text x="810" y="480" class="header">Redis Queue</text>
|
167
|
+
<text x="680" y="500" class="small-label">• Production systems</text>
|
168
|
+
<text x="680" y="515" class="small-label">• Message persistence</text>
|
169
|
+
<text x="680" y="530" class="small-label">• Load balancing</text>
|
170
|
+
<text x="680" y="545" class="small-label">• Enterprise features</text>
|
171
|
+
</svg>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// MathJax configuration for SmartMessage documentation
|
2
|
+
window.MathJax = {
|
3
|
+
tex: {
|
4
|
+
inlineMath: [["\\(", "\\)"]],
|
5
|
+
displayMath: [["\\[", "\\]"]],
|
6
|
+
processEscapes: true,
|
7
|
+
processEnvironments: true
|
8
|
+
},
|
9
|
+
options: {
|
10
|
+
ignoreHtmlClass: ".*|",
|
11
|
+
processHtmlClass: "arithmatex"
|
12
|
+
}
|
13
|
+
};
|
14
|
+
|
15
|
+
document$.subscribe(() => {
|
16
|
+
MathJax.typesetPromise()
|
17
|
+
})
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/* Custom styles for SmartMessage documentation */
|
2
|
+
|
3
|
+
/* Make header/navigation text more prominent */
|
4
|
+
.md-header__title {
|
5
|
+
font-size: 1.2rem !important;
|
6
|
+
font-weight: 700 !important;
|
7
|
+
}
|
8
|
+
|
9
|
+
.md-header__topic {
|
10
|
+
font-weight: 600 !important;
|
11
|
+
}
|
12
|
+
|
13
|
+
/* Make navigation tabs larger and bolder */
|
14
|
+
.md-tabs__link {
|
15
|
+
font-size: 0.9rem !important;
|
16
|
+
font-weight: 600 !important;
|
17
|
+
text-transform: uppercase;
|
18
|
+
letter-spacing: 0.5px;
|
19
|
+
}
|
20
|
+
|
21
|
+
/* Active tab styling */
|
22
|
+
.md-tabs__link--active {
|
23
|
+
font-weight: 700 !important;
|
24
|
+
}
|
25
|
+
|
26
|
+
/* Navigation drawer items */
|
27
|
+
.md-nav__link {
|
28
|
+
font-size: 0.85rem !important;
|
29
|
+
}
|
30
|
+
|
31
|
+
.md-nav__link--active {
|
32
|
+
font-weight: 600 !important;
|
33
|
+
}
|
34
|
+
|
35
|
+
/* Section headers in navigation */
|
36
|
+
.md-nav__title {
|
37
|
+
font-weight: 700 !important;
|
38
|
+
font-size: 0.9rem !important;
|
39
|
+
}
|
40
|
+
|
41
|
+
/* Search bar text */
|
42
|
+
.md-search__input {
|
43
|
+
font-size: 0.9rem !important;
|
44
|
+
}
|
45
|
+
|
46
|
+
/* Make the site name in header extra prominent */
|
47
|
+
.md-header__title .md-header__ellipsis {
|
48
|
+
font-size: 1.3rem !important;
|
49
|
+
font-weight: 800 !important;
|
50
|
+
letter-spacing: 0.5px;
|
51
|
+
}
|
@@ -256,19 +256,17 @@ request.publish
|
|
256
256
|
|
257
257
|
# In user-service handler:
|
258
258
|
class UserLookupRequest
|
259
|
-
def self.process(
|
260
|
-
request_data = JSON.parse(payload)
|
261
|
-
|
259
|
+
def self.process(decoded_message)
|
262
260
|
# Process lookup...
|
263
|
-
user_data = UserService.find(
|
261
|
+
user_data = UserService.find(decoded_message.user_id)
|
264
262
|
|
265
263
|
# Send response back to reply_to address
|
266
264
|
response = UserLookupResponse.new(
|
267
|
-
user_id:
|
268
|
-
request_id:
|
265
|
+
user_id: decoded_message.user_id,
|
266
|
+
request_id: decoded_message.request_id,
|
269
267
|
user_data: user_data
|
270
268
|
)
|
271
|
-
response.to(
|
269
|
+
response.to(decoded_message._sm_header.reply_to) # Send to original reply_to
|
272
270
|
response.publish
|
273
271
|
end
|
274
272
|
end
|