smart_message 0.0.10 → 0.0.13
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 +64 -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} +80 -145
- 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} +103 -89
- data/docs/{getting-started.md → getting-started/quick-start.md} +47 -23
- 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/reference/serializers.md +245 -0
- data/docs/{transports.md → reference/transports.md} +9 -11
- data/docs/transports/memory-transport.md +374 -0
- data/docs/transports/redis-transport-comparison.md +361 -0
- data/docs/transports/redis-transport.md +490 -0
- data/examples/README.md +104 -14
- 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 +80 -0
- data/examples/city_scenario/messages/emergency_resolved_message.rb +42 -0
- data/examples/city_scenario/messages/fire_dispatch_message.rb +42 -0
- data/examples/city_scenario/messages/fire_emergency_message.rb +44 -0
- data/examples/city_scenario/messages/health_check_message.rb +21 -0
- data/examples/city_scenario/messages/health_status_message.rb +34 -0
- data/examples/city_scenario/messages/police_dispatch_message.rb +45 -0
- data/examples/city_scenario/messages/silent_alarm_message.rb +37 -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 -3
- data/examples/{09_dead_letter_queue_demo.rb → memory/02_dead_letter_queue_demo.rb} +10 -40
- data/examples/{01_point_to_point_orders.rb → memory/03_point_to_point_orders.rb} +1 -3
- data/examples/{02_publish_subscribe_events.rb → memory/04_publish_subscribe_events.rb} +1 -2
- data/examples/{03_many_to_many_chat.rb → memory/05_many_to_many_chat.rb} +1 -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} +1 -2
- data/examples/{06_custom_logger_example.rb → memory/08_custom_logger_demo.rb} +13 -14
- data/examples/{07_error_handling_scenarios.rb → memory/09_error_handling_demo.rb} +1 -4
- data/examples/{08_entity_addressing_basic.rb → memory/10_entity_addressing_basic.rb} +2 -8
- data/examples/{08_entity_addressing_with_filtering.rb → memory/11_entity_addressing_with_filtering.rb} +2 -6
- data/examples/{09_regex_filtering_microservices.rb → memory/12_regex_filtering_microservices.rb} +1 -2
- data/examples/{10_header_block_configuration.rb → memory/13_header_block_configuration.rb} +1 -6
- data/examples/{11_global_configuration_example.rb → memory/14_global_configuration_demo.rb} +17 -8
- data/examples/{show_logger.rb → memory/15_logger_demo.rb} +1 -2
- 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} +1 -5
- data/examples/redis/README.md +228 -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/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 +19 -12
- data/lib/smart_message/configuration.rb +2 -23
- data/lib/smart_message/dead_letter_queue.rb +1 -1
- data/lib/smart_message/logger.rb +15 -4
- data/lib/smart_message/messaging.rb +3 -62
- data/lib/smart_message/plugins.rb +6 -44
- data/lib/smart_message/serializer.rb +14 -0
- data/lib/smart_message/transport/base.rb +42 -8
- data/lib/smart_message/transport/memory_transport.rb +23 -4
- data/lib/smart_message/transport/redis_transport.rb +11 -0
- data/lib/smart_message/transport/stdout_transport.rb +28 -10
- data/lib/smart_message/transport.rb +33 -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 +145 -45
- data/docs/README.md +0 -57
- data/docs/serializers.md +0 -575
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38b75aa70a9ab79b0fd9ac311d7e5634491789e5813161630ff7e04f17d61373
|
4
|
+
data.tar.gz: 8196665b3a660cfaad1c30753697f020c4a54b50c25d23be6f6c3c6ad9149e38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 876f94f732eb022c568a200747438ab6a0938602735f89601fc7c9e48f34bf21791c75608b2d877475d9190a9629974a63448f5ceb6eeb24bf073b0cc1e4ee19
|
7
|
+
data.tar.gz: 310150522f4d6561c40e7322072a75778867b643b5eb6b79364b750a39689e27cbfd7c7022ae0f0c8a44ae9a850549c02e94005930d4b878ba75cb1eb1192a58
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: Deploy Documentation to GitHub Pages
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
paths:
|
7
|
+
- "docs/**"
|
8
|
+
- "mkdocs.yml"
|
9
|
+
- ".github/workflows/deploy-github-pages.yml"
|
10
|
+
workflow_dispatch:
|
11
|
+
|
12
|
+
permissions:
|
13
|
+
contents: write
|
14
|
+
pages: write
|
15
|
+
id-token: write
|
16
|
+
|
17
|
+
jobs:
|
18
|
+
deploy:
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
steps:
|
21
|
+
- name: Checkout code
|
22
|
+
uses: actions/checkout@v4
|
23
|
+
with:
|
24
|
+
fetch-depth: 0
|
25
|
+
|
26
|
+
- name: Setup Python
|
27
|
+
uses: actions/setup-python@v5
|
28
|
+
with:
|
29
|
+
python-version: 3.x
|
30
|
+
|
31
|
+
- name: Install dependencies
|
32
|
+
run: |
|
33
|
+
pip install mkdocs
|
34
|
+
pip install mkdocs-material
|
35
|
+
pip install mkdocs-macros-plugin
|
36
|
+
|
37
|
+
- name: Deploy to GitHub Pages
|
38
|
+
run: mkdocs gh-deploy --force
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,70 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.0.13] 2025-09-10
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- **BREAKING: Transport-Level Serialization Architecture**: Major architectural rework moving serializer responsibility from message classes to transport layer
|
14
|
+
- **Core Change**: Serializers now associated with transports instead of message classes, enabling different transports to use different serialization formats
|
15
|
+
- **Message Structure**: Eliminated wrapper objects in favor of flat message structure with `_sm_header` routing metadata
|
16
|
+
- **Serialization Format**: Messages now serialized as single JSON objects containing both header and payload data (e.g., `{"_sm_header": {...}, "content": "value", "property": "data"}`)
|
17
|
+
- **Transport Flexibility**: Each transport can now use its own serializer (JSON, MessagePack, etc.) independently
|
18
|
+
- **Backward Compatibility**: Added `_sm_payload` and `split` methods to maintain compatibility with existing proc handlers
|
19
|
+
- **Performance**: Simplified message processing pipeline with direct message instance passing instead of complex wrapper handling
|
20
|
+
|
21
|
+
### Fixed
|
22
|
+
- **Message Reconstruction**: Fixed critical bug in `SmartMessage::Base#initialize` where payload properties were not properly extracted from flat serialized structure
|
23
|
+
- **Root Cause**: Initialization logic looked for `props[:_sm_payload]` but flat structure stores properties directly in `props`
|
24
|
+
- **Solution**: Changed to `payload_props = props.except(:_sm_header)` to extract all non-header properties
|
25
|
+
- **Impact**: Proc handlers now receive correct message content, resolving nil property values in `_sm_payload`
|
26
|
+
- **Circuit Breaker Test Compatibility**: Updated circuit breaker tests to use new transport method signatures
|
27
|
+
- **Issue**: Tests were calling `transport.publish(header, payload)` with two arguments
|
28
|
+
- **Fix**: Updated to `transport.publish(message_instance)` with single message parameter
|
29
|
+
- **Result**: All circuit breaker tests now pass with new architecture
|
30
|
+
- **Deduplication Test Format**: Updated deduplication tests from old wrapper format to new flat structure
|
31
|
+
- **Changed**: `_sm_payload: { content: "value" }` → `content: "value"`
|
32
|
+
- **Maintained**: Full deduplication functionality with handler-scoped DDQ system
|
33
|
+
|
34
|
+
### Enhanced
|
35
|
+
- **Transport Serialization Control**: Each transport implementation can now specify its preferred serializer
|
36
|
+
- **Memory Transport**: Returns message objects directly without serialization for performance
|
37
|
+
- **STDOUT Transport**: Uses JSON serializer with pretty printing for human readability
|
38
|
+
- **Redis Transport**: Uses MessagePack with JSON fallback for efficient network transmission
|
39
|
+
- **Message Processing Pipeline**: Streamlined architecture with direct message instance routing
|
40
|
+
- **Eliminated**: Complex wrapper object creation and management overhead
|
41
|
+
- **Simplified**: Transport `receive` method now directly reconstructs message instances from flat data
|
42
|
+
- **Improved**: Cleaner separation between transport concerns and message processing logic
|
43
|
+
|
44
|
+
### Added
|
45
|
+
- **Emergency Services Multi-Program Demo**: Complete emergency dispatch simulation system
|
46
|
+
- Added comprehensive emergency services message definitions with validation
|
47
|
+
- Emergency Dispatch Center (911) routing calls to appropriate departments
|
48
|
+
- Fire Department, Police Department, and Health Department service implementations
|
49
|
+
- AI-powered visitor generating realistic emergency scenarios with retry logic
|
50
|
+
- Health monitoring system across all city services with status reporting
|
51
|
+
- Continuous observation generation with diverse emergency scenarios every 15 seconds
|
52
|
+
|
53
|
+
### Enhanced
|
54
|
+
- **Message Definition Property System**: Improved DRY principles and AI integration
|
55
|
+
- Extracted inline array validations into VALID_* constants (VALID_SEVERITY, VALID_EMERGENCY_TYPES, etc.)
|
56
|
+
- Updated property descriptions to use constants dynamically (#{VALID_SEVERITY.join(', ')})
|
57
|
+
- Enhanced property descriptions to include valid values for better AI prompting
|
58
|
+
- Standardized validation message format using constant interpolation across all message types
|
59
|
+
- **SmartMessage Class-Level Addressing**: Added setter method support for flexible syntax
|
60
|
+
- Added from=, to=, reply_to= setter methods to complement existing getter methods
|
61
|
+
- Enables both ClassName.from(value) and ClassName.from = value syntax patterns
|
62
|
+
- Maintains backward compatibility while improving developer experience
|
63
|
+
|
64
|
+
### Added
|
65
|
+
- **Documentation Website**: MkDocs-based documentation site with GitHub Pages deployment
|
66
|
+
- Added `mkdocs.yml` configuration with Material theme and SmartMessage branding
|
67
|
+
- Created GitHub Actions workflow (`.github/workflows/deploy-github-pages.yml`) for automatic documentation deployment
|
68
|
+
- Reorganized documentation structure into logical sections: Getting Started, Core Concepts, Reference, and Development
|
69
|
+
- Added custom CSS styling for improved header visibility and readability
|
70
|
+
- Integrated SmartMessage logo and branding throughout the documentation
|
71
|
+
- Documentation now automatically deploys to GitHub Pages on push to master branch
|
72
|
+
- Live documentation available at: https://madbomber.github.io/smart_message/
|
73
|
+
|
10
74
|
## [0.0.10] 2025-08-20
|
11
75
|
### Added
|
12
76
|
- **Handler-Scoped Message Deduplication**: Advanced DDQ (Deduplication Queue) system with automatic handler isolation
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smart_message (0.0.
|
4
|
+
smart_message (0.0.13)
|
5
5
|
activesupport
|
6
|
+
async
|
7
|
+
async-redis
|
6
8
|
breaker_machines
|
7
9
|
colorize
|
8
10
|
concurrent-ruby
|
@@ -28,9 +30,23 @@ GEM
|
|
28
30
|
tzinfo (~> 2.0, >= 2.0.5)
|
29
31
|
uri (>= 0.13.1)
|
30
32
|
amazing_print (1.8.1)
|
33
|
+
async (2.31.0)
|
34
|
+
console (~> 1.29)
|
35
|
+
fiber-annotation
|
36
|
+
io-event (~> 1.11)
|
37
|
+
metrics (~> 0.12)
|
38
|
+
traces (~> 0.18)
|
39
|
+
async-pool (0.11.0)
|
40
|
+
async (>= 2.0)
|
41
|
+
async-redis (0.12.0)
|
42
|
+
async (~> 2.10)
|
43
|
+
async-pool (~> 0.2)
|
44
|
+
io-endpoint (~> 0.10)
|
45
|
+
io-stream (~> 0.4)
|
46
|
+
protocol-redis (~> 0.11)
|
31
47
|
base64 (0.3.0)
|
32
48
|
benchmark (0.4.1)
|
33
|
-
bigdecimal (3.2.
|
49
|
+
bigdecimal (3.2.3)
|
34
50
|
breaker_machines (0.4.0)
|
35
51
|
activesupport (>= 7.2)
|
36
52
|
concurrent-ruby (~> 1.3)
|
@@ -38,20 +54,34 @@ GEM
|
|
38
54
|
zeitwerk (~> 2.7)
|
39
55
|
colorize (1.1.0)
|
40
56
|
concurrent-ruby (1.3.5)
|
41
|
-
connection_pool (2.5.
|
57
|
+
connection_pool (2.5.4)
|
58
|
+
console (1.34.0)
|
59
|
+
fiber-annotation
|
60
|
+
fiber-local (~> 1.1)
|
61
|
+
json
|
42
62
|
debug_me (1.1.1)
|
43
63
|
drb (2.2.3)
|
64
|
+
fiber-annotation (0.2.0)
|
65
|
+
fiber-local (1.1.0)
|
66
|
+
fiber-storage
|
67
|
+
fiber-storage (1.0.1)
|
44
68
|
hashie (5.0.0)
|
45
69
|
i18n (1.14.7)
|
46
70
|
concurrent-ruby (~> 1.0)
|
71
|
+
io-endpoint (0.15.2)
|
72
|
+
io-event (1.14.0)
|
73
|
+
io-stream (0.10.0)
|
74
|
+
json (2.13.2)
|
47
75
|
logger (1.7.0)
|
48
|
-
lumberjack (1.4.
|
76
|
+
lumberjack (1.4.1)
|
77
|
+
metrics (0.14.1)
|
49
78
|
minitest (5.25.5)
|
50
79
|
minitest-power_assert (0.3.1)
|
51
80
|
minitest
|
52
81
|
power_assert (>= 1.1)
|
53
82
|
mutex_m (0.3.0)
|
54
83
|
power_assert (2.0.5)
|
84
|
+
protocol-redis (0.12.0)
|
55
85
|
rake (13.3.0)
|
56
86
|
redis (5.4.1)
|
57
87
|
redis-client (>= 0.22.0)
|
@@ -65,6 +95,7 @@ GEM
|
|
65
95
|
shoulda-matchers (4.5.1)
|
66
96
|
activesupport (>= 4.2.0)
|
67
97
|
state_machines (0.100.1)
|
98
|
+
traces (0.18.2)
|
68
99
|
tzinfo (2.0.6)
|
69
100
|
concurrent-ruby (~> 1.0)
|
70
101
|
uri (1.0.3)
|