bunny_farm 0.1.2

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 (106) hide show
  1. checksums.yaml +7 -0
  2. data/.envrc +1 -0
  3. data/.github/workflows/docs.yml +38 -0
  4. data/.gitignore +11 -0
  5. data/.travis.yml +3 -0
  6. data/CHANGELOG.md +61 -0
  7. data/COMMITS.md +196 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +330 -0
  11. data/Rakefile +9 -0
  12. data/bunny_farm.gemspec +30 -0
  13. data/config/bunny.yml.erb +29 -0
  14. data/config/bunny_test.yml.erb +29 -0
  15. data/config/hipchat.yml.erb +12 -0
  16. data/docs/api/configuration.md +9 -0
  17. data/docs/api/consumer.md +8 -0
  18. data/docs/api/message-class.md +419 -0
  19. data/docs/api/publisher.md +9 -0
  20. data/docs/architecture/integration.md +8 -0
  21. data/docs/architecture/message-flow.md +11 -0
  22. data/docs/architecture/overview.md +448 -0
  23. data/docs/architecture/scaling.md +8 -0
  24. data/docs/assets/actions_dsl_flow.svg +109 -0
  25. data/docs/assets/architecture_overview.svg +152 -0
  26. data/docs/assets/best_practices_patterns.svg +203 -0
  27. data/docs/assets/bunny_farm_logo.png +0 -0
  28. data/docs/assets/configuration_api_methods.svg +104 -0
  29. data/docs/assets/configuration_flow.svg +130 -0
  30. data/docs/assets/configuration_hierarchy.svg +70 -0
  31. data/docs/assets/data_processing_pipeline.svg +131 -0
  32. data/docs/assets/debugging_monitoring.svg +165 -0
  33. data/docs/assets/ecommerce_example_flow.svg +145 -0
  34. data/docs/assets/email_campaign_example.svg +127 -0
  35. data/docs/assets/environment_variables_map.svg +78 -0
  36. data/docs/assets/error_handling_flow.svg +114 -0
  37. data/docs/assets/favicon.ico +1 -0
  38. data/docs/assets/fields_dsl_structure.svg +89 -0
  39. data/docs/assets/instance_methods_lifecycle.svg +137 -0
  40. data/docs/assets/integration_patterns.svg +207 -0
  41. data/docs/assets/json_serialization_flow.svg +153 -0
  42. data/docs/assets/logo.svg +4 -0
  43. data/docs/assets/message_api_overview.svg +126 -0
  44. data/docs/assets/message_encapsulation.svg +113 -0
  45. data/docs/assets/message_lifecycle.svg +110 -0
  46. data/docs/assets/message_structure.svg +138 -0
  47. data/docs/assets/publisher_consumer_api.svg +120 -0
  48. data/docs/assets/scaling_deployment_patterns.svg +195 -0
  49. data/docs/assets/smart_routing_diagram.svg +131 -0
  50. data/docs/assets/system_architecture_overview.svg +155 -0
  51. data/docs/assets/task_scheduling_flow.svg +139 -0
  52. data/docs/assets/testing_strategies.svg +146 -0
  53. data/docs/assets/workflow_patterns.svg +183 -0
  54. data/docs/assets/yaml_config_structure.svg +72 -0
  55. data/docs/configuration/environment-variables.md +14 -0
  56. data/docs/configuration/overview.md +373 -0
  57. data/docs/configuration/programmatic-setup.md +10 -0
  58. data/docs/configuration/yaml-configuration.md +12 -0
  59. data/docs/core-features/configuration.md +528 -0
  60. data/docs/core-features/error-handling.md +82 -0
  61. data/docs/core-features/json-serialization.md +545 -0
  62. data/docs/core-features/message-design.md +406 -0
  63. data/docs/core-features/smart-routing.md +467 -0
  64. data/docs/core-features/task-scheduling.md +67 -0
  65. data/docs/core-features/workflow-support.md +112 -0
  66. data/docs/development/contributing.md +345 -0
  67. data/docs/development/roadmap.md +9 -0
  68. data/docs/development/testing.md +14 -0
  69. data/docs/examples/order-processing.md +10 -0
  70. data/docs/examples/overview.md +269 -0
  71. data/docs/examples/real-world.md +8 -0
  72. data/docs/examples/simple-producer-consumer.md +15 -0
  73. data/docs/examples/task-scheduler.md +9 -0
  74. data/docs/getting-started/basic-concepts.md +274 -0
  75. data/docs/getting-started/installation.md +122 -0
  76. data/docs/getting-started/quick-start.md +158 -0
  77. data/docs/index.md +106 -0
  78. data/docs/message-structure/actions-dsl.md +163 -0
  79. data/docs/message-structure/fields-dsl.md +146 -0
  80. data/docs/message-structure/instance-methods.md +115 -0
  81. data/docs/message-structure/overview.md +211 -0
  82. data/examples/README.md +212 -0
  83. data/examples/consumer.rb +41 -0
  84. data/examples/images/message_flow.svg +87 -0
  85. data/examples/images/order_workflow.svg +122 -0
  86. data/examples/images/producer_consumer.svg +96 -0
  87. data/examples/images/task_scheduler.svg +140 -0
  88. data/examples/order_processor.rb +238 -0
  89. data/examples/producer.rb +60 -0
  90. data/examples/simple_message.rb +43 -0
  91. data/examples/task_scheduler.rb +263 -0
  92. data/images/architecture_overview.svg +152 -0
  93. data/images/bunny_farm_logo.png +0 -0
  94. data/images/configuration_flow.svg +130 -0
  95. data/images/message_structure.svg +138 -0
  96. data/lib/bunny_farm/.irbrc +7 -0
  97. data/lib/bunny_farm/generic_consumer.rb +12 -0
  98. data/lib/bunny_farm/hash_ext.rb +37 -0
  99. data/lib/bunny_farm/init_bunny.rb +137 -0
  100. data/lib/bunny_farm/init_hipchat.rb +49 -0
  101. data/lib/bunny_farm/message.rb +218 -0
  102. data/lib/bunny_farm/message_elements.rb +25 -0
  103. data/lib/bunny_farm/version.rb +3 -0
  104. data/lib/bunny_farm.rb +9 -0
  105. data/mkdocs.yml +148 -0
  106. metadata +244 -0
@@ -0,0 +1,120 @@
1
+ <svg width="900" height="600" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="900" height="600" fill="transparent"/>
3
+
4
+ <!-- Title -->
5
+ <text x="450" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#e0e0e0">
6
+ Publisher and Consumer API
7
+ </text>
8
+
9
+ <!-- Publisher Section -->
10
+ <g>
11
+ <text x="225" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#68d391">
12
+ Publisher API
13
+ </text>
14
+
15
+ <rect x="50" y="90" width="350" height="200" rx="8" fill="#2d3748" stroke="#68d391" stroke-width="2"/>
16
+ <text x="225" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#68d391">BunnyFarm::Publisher</text>
17
+
18
+ <!-- Publisher Methods -->
19
+ <text x="70" y="140" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#4299e1">Core Methods:</text>
20
+ <text x="80" y="160" font-family="monospace" font-size="11" fill="#e0e0e0">publish(message, action)</text>
21
+ <text x="80" y="175" font-family="monospace" font-size="11" fill="#e0e0e0">publish_at(message, action, time)</text>
22
+ <text x="80" y="190" font-family="monospace" font-size="11" fill="#e0e0e0">publish_in(message, action, delay)</text>
23
+ <text x="80" y="205" font-family="monospace" font-size="11" fill="#e0e0e0">schedule(message, action, cron)</text>
24
+
25
+ <text x="70" y="230" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#9f7aea">Configuration:</text>
26
+ <text x="80" y="250" font-family="monospace" font-size="11" fill="#e0e0e0">configure(options)</text>
27
+ <text x="80" y="265" font-family="monospace" font-size="11" fill="#e0e0e0">connection_settings</text>
28
+ <text x="80" y="280" font-family="monospace" font-size="11" fill="#e0e0e0">exchange_settings</text>
29
+ </g>
30
+
31
+ <!-- Consumer Section -->
32
+ <g>
33
+ <text x="675" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#f6e05e">
34
+ Consumer API
35
+ </text>
36
+
37
+ <rect x="500" y="90" width="350" height="200" rx="8" fill="#2d3748" stroke="#f6e05e" stroke-width="2"/>
38
+ <text x="675" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#f6e05e">BunnyFarm::Consumer</text>
39
+
40
+ <!-- Consumer Methods -->
41
+ <text x="520" y="140" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#4299e1">Core Methods:</text>
42
+ <text x="530" y="160" font-family="monospace" font-size="11" fill="#e0e0e0">start</text>
43
+ <text x="530" y="175" font-family="monospace" font-size="11" fill="#e0e0e0">stop</text>
44
+ <text x="530" y="190" font-family="monospace" font-size="11" fill="#e0e0e0">process_message(msg, action)</text>
45
+ <text x="530" y="205" font-family="monospace" font-size="11" fill="#e0e0e0">handle_error(error, msg)</text>
46
+
47
+ <text x="520" y="230" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#9f7aea">Queue Management:</text>
48
+ <text x="530" y="250" font-family="monospace" font-size="11" fill="#e0e0e0">bind_queue(pattern)</text>
49
+ <text x="530" y="265" font-family="monospace" font-size="11" fill="#e0e0e0">unbind_queue(pattern)</text>
50
+ <text x="530" y="280" font-family="monospace" font-size="11" fill="#e0e0e0">purge_queue</text>
51
+ </g>
52
+
53
+ <!-- Usage Examples -->
54
+ <g>
55
+ <text x="450" y="340" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#e0e0e0">
56
+ API Usage Examples
57
+ </text>
58
+
59
+ <!-- Publisher Example -->
60
+ <rect x="50" y="360" width="380" height="140" rx="6" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
61
+ <text x="240" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" font-weight="bold" fill="#68d391">Publisher Usage</text>
62
+
63
+ <text x="70" y="400" font-family="monospace" font-size="10" fill="#9ca3af"># Initialize publisher</text>
64
+ <text x="70" y="415" font-family="monospace" font-size="10" fill="#e0e0e0">publisher = BunnyFarm::Publisher.new</text>
65
+ <text x="70" y="435" font-family="monospace" font-size="10" fill="#9ca3af"># Create and publish message</text>
66
+ <text x="70" y="450" font-family="monospace" font-size="10" fill="#e0e0e0">message = OrderMessage.new(order_id: 123)</text>
67
+ <text x="70" y="465" font-family="monospace" font-size="10" fill="#e0e0e0">publisher.publish(message, 'process')</text>
68
+ <text x="70" y="485" font-family="monospace" font-size="10" fill="#9ca3af"># Delayed publishing</text>
69
+ <text x="70" y="500" font-family="monospace" font-size="10" fill="#e0e0e0">publisher.publish_in(message, 'remind', 1.hour)</text>
70
+
71
+ <!-- Consumer Example -->
72
+ <rect x="450" y="360" width="380" height="140" rx="6" fill="#1a202c" stroke="#f6e05e" stroke-width="1"/>
73
+ <text x="640" y="380" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" font-weight="bold" fill="#f6e05e">Consumer Usage</text>
74
+
75
+ <text x="470" y="400" font-family="monospace" font-size="10" fill="#9ca3af"># Initialize consumer</text>
76
+ <text x="470" y="415" font-family="monospace" font-size="10" fill="#e0e0e0">consumer = BunnyFarm::Consumer.new</text>
77
+ <text x="470" y="435" font-family="monospace" font-size="10" fill="#9ca3af"># Bind to routing patterns</text>
78
+ <text x="470" y="450" font-family="monospace" font-size="10" fill="#e0e0e0">consumer.bind_queue("OrderMessage.*")</text>
79
+ <text x="470" y="465" font-family="monospace" font-size="10" fill="#e0e0e0">consumer.bind_queue("*.urgent")</text>
80
+ <text x="470" y="485" font-family="monospace" font-size="10" fill="#9ca3af"># Start processing</text>
81
+ <text x="470" y="500" font-family="monospace" font-size="10" fill="#e0e0e0">consumer.start</text>
82
+ </g>
83
+
84
+ <!-- Configuration Options -->
85
+ <g>
86
+ <text x="450" y="540" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#e0e0e0">
87
+ Configuration Options
88
+ </text>
89
+
90
+ <!-- Publisher Config -->
91
+ <rect x="50" y="560" width="180" height="35" rx="4" fill="#2d3748" stroke="#68d391" stroke-width="1"/>
92
+ <text x="140" y="575" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#68d391">Publisher Config</text>
93
+ <text x="60" y="590" font-family="monospace" font-size="9" fill="#e0e0e0">exchange, routing_key_prefix</text>
94
+
95
+ <!-- Consumer Config -->
96
+ <rect x="250" y="560" width="180" height="35" rx="4" fill="#2d3748" stroke="#f6e05e" stroke-width="1"/>
97
+ <text x="340" y="575" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#f6e05e">Consumer Config</text>
98
+ <text x="260" y="590" font-family="monospace" font-size="9" fill="#e0e0e0">queue_name, concurrency</text>
99
+
100
+ <!-- Connection Config -->
101
+ <rect x="450" y="560" width="180" height="35" rx="4" fill="#2d3748" stroke="#4299e1" stroke-width="1"/>
102
+ <text x="540" y="575" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#4299e1">Connection Config</text>
103
+ <text x="460" y="590" font-family="monospace" font-size="9" fill="#e0e0e0">host, port, vhost, credentials</text>
104
+
105
+ <!-- Error Handling Config -->
106
+ <rect x="650" y="560" width="180" height="35" rx="4" fill="#2d3748" stroke="#e53e3e" stroke-width="1"/>
107
+ <text x="740" y="575" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e53e3e">Error Config</text>
108
+ <text x="660" y="590" font-family="monospace" font-size="9" fill="#e0e0e0">retry_attempts, dead_letter_queue</text>
109
+ </g>
110
+
111
+ <!-- Message Flow Arrow -->
112
+ <defs>
113
+ <marker id="arrow-flow" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
114
+ <polygon points="0 0, 10 3.5, 0 7" fill="#ff9800"/>
115
+ </marker>
116
+ </defs>
117
+
118
+ <line x1="400" y1="190" x2="500" y2="190" stroke="#ff9800" stroke-width="3" marker-end="url(#arrow-flow)"/>
119
+ <text x="450" y="185" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#ff9800">Messages</text>
120
+ </svg>
@@ -0,0 +1,195 @@
1
+ <svg width="1000" height="700" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="1000" height="700" fill="transparent"/>
3
+
4
+ <!-- Title -->
5
+ <text x="500" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="18" font-weight="bold" fill="#e0e0e0">
6
+ Scaling and Deployment Patterns
7
+ </text>
8
+
9
+ <!-- Single Instance Pattern -->
10
+ <g>
11
+ <text x="200" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#68d391">
12
+ Single Instance (Development)
13
+ </text>
14
+
15
+ <rect x="50" y="90" width="300" height="140" rx="8" fill="#2d3748" stroke="#68d391" stroke-width="2"/>
16
+
17
+ <!-- Single App -->
18
+ <rect x="80" y="120" width="100" height="40" rx="4" fill="#1a202c" stroke="#4299e1" stroke-width="1"/>
19
+ <text x="130" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#4299e1">Rails App</text>
20
+
21
+ <!-- Single RabbitMQ -->
22
+ <rect x="80" y="180" width="100" height="40" rx="4" fill="#1a202c" stroke="#2b6cb0" stroke-width="1"/>
23
+ <text x="130" y="205" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#2b6cb0">RabbitMQ</text>
24
+
25
+ <!-- Worker Process -->
26
+ <rect x="200" y="120" width="100" height="40" rx="4" fill="#1a202c" stroke="#f6e05e" stroke-width="1"/>
27
+ <text x="250" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#f6e05e">Worker</text>
28
+
29
+ <!-- Features -->
30
+ <text x="200" y="255" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#68d391">Features:</text>
31
+ <text x="70" y="275" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Simple setup</text>
32
+ <text x="70" y="290" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Low resource usage</text>
33
+ <text x="70" y="305" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Easy debugging</text>
34
+ </g>
35
+
36
+ <!-- Multi-Worker Pattern -->
37
+ <g>
38
+ <text x="500" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#4299e1">
39
+ Multi-Worker (Production)
40
+ </text>
41
+
42
+ <rect x="380" y="90" width="240" height="140" rx="8" fill="#2d3748" stroke="#4299e1" stroke-width="2"/>
43
+
44
+ <!-- Web Servers -->
45
+ <rect x="400" y="120" width="60" height="30" rx="3" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
46
+ <text x="430" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#68d391">Web 1</text>
47
+
48
+ <rect x="470" y="120" width="60" height="30" rx="3" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
49
+ <text x="500" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#68d391">Web 2</text>
50
+
51
+ <rect x="540" y="120" width="60" height="30" rx="3" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
52
+ <text x="570" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#68d391">Web 3</text>
53
+
54
+ <!-- RabbitMQ Cluster -->
55
+ <rect x="400" y="160" width="200" height="30" rx="3" fill="#1a202c" stroke="#2b6cb0" stroke-width="1"/>
56
+ <text x="500" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#2b6cb0">RabbitMQ Cluster</text>
57
+
58
+ <!-- Specialized Workers -->
59
+ <rect x="400" y="200" width="45" height="20" rx="2" fill="#1a202c" stroke="#f6e05e" stroke-width="1"/>
60
+ <text x="422" y="213" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f6e05e">Orders</text>
61
+
62
+ <rect x="450" y="200" width="45" height="20" rx="2" fill="#1a202c" stroke="#9f7aea" stroke-width="1"/>
63
+ <text x="472" y="213" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9f7aea">Emails</text>
64
+
65
+ <rect x="500" y="200" width="45" height="20" rx="2" fill="#1a202c" stroke="#e53e3e" stroke-width="1"/>
66
+ <text x="522" y="213" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e53e3e">Reports</text>
67
+
68
+ <rect x="555" y="200" width="45" height="20" rx="2" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
69
+ <text x="577" y="213" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#68d391">Tasks</text>
70
+
71
+ <!-- Features -->
72
+ <text x="500" y="255" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#4299e1">Features:</text>
73
+ <text x="400" y="275" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• High availability</text>
74
+ <text x="400" y="290" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Specialized workers</text>
75
+ <text x="400" y="305" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Load distribution</text>
76
+ </g>
77
+
78
+ <!-- Microservices Pattern -->
79
+ <g>
80
+ <text x="800" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#9f7aea">
81
+ Microservices (Enterprise)
82
+ </text>
83
+
84
+ <rect x="680" y="90" width="240" height="140" rx="8" fill="#2d3748" stroke="#9f7aea" stroke-width="2"/>
85
+
86
+ <!-- Service A -->
87
+ <rect x="700" y="110" width="80" height="25" rx="3" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
88
+ <text x="740" y="127" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#68d391">User Service</text>
89
+
90
+ <!-- Service B -->
91
+ <rect x="790" y="110" width="80" height="25" rx="3" fill="#1a202c" stroke="#4299e1" stroke-width="1"/>
92
+ <text x="830" y="127" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#4299e1">Order Service</text>
93
+
94
+ <!-- Service C -->
95
+ <rect x="700" y="145" width="80" height="25" rx="3" fill="#1a202c" stroke="#f6e05e" stroke-width="1"/>
96
+ <text x="740" y="162" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f6e05e">Email Service</text>
97
+
98
+ <!-- Service D -->
99
+ <rect x="790" y="145" width="80" height="25" rx="3" fill="#1a202c" stroke="#e53e3e" stroke-width="1"/>
100
+ <text x="830" y="162" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e53e3e">Analytics Service</text>
101
+
102
+ <!-- Message Bus -->
103
+ <rect x="700" y="180" width="170" height="30" rx="3" fill="#1a202c" stroke="#ff9800" stroke-width="2"/>
104
+ <text x="785" y="200" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#ff9800">BunnyFarm Message Bus</text>
105
+
106
+ <!-- Features -->
107
+ <text x="800" y="255" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#9f7aea">Features:</text>
108
+ <text x="700" y="275" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Service isolation</text>
109
+ <text x="700" y="290" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Language agnostic</text>
110
+ <text x="700" y="305" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Independent scaling</text>
111
+ </g>
112
+
113
+ <!-- Deployment Strategies -->
114
+ <g>
115
+ <text x="500" y="370" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#e0e0e0">
116
+ Deployment Strategies
117
+ </text>
118
+
119
+ <!-- Docker Strategy -->
120
+ <rect x="50" y="400" width="280" height="120" rx="6" fill="#2d3748" stroke="#4299e1" stroke-width="1"/>
121
+ <text x="190" y="425" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" font-weight="bold" fill="#4299e1">Docker Containers</text>
122
+
123
+ <text x="70" y="450" font-family="monospace" font-size="10" fill="#68d391"># Dockerfile</text>
124
+ <text x="70" y="465" font-family="monospace" font-size="10" fill="#e0e0e0">FROM ruby:3.1</text>
125
+ <text x="70" y="480" font-family="monospace" font-size="10" fill="#e0e0e0">RUN gem install bunny_farm</text>
126
+ <text x="70" y="495" font-family="monospace" font-size="10" fill="#e0e0e0">COPY . /app</text>
127
+ <text x="70" y="510" font-family="monospace" font-size="10" fill="#e0e0e0">CMD ["bundle", "exec", "bunny_farm"]</text>
128
+
129
+ <!-- Kubernetes Strategy -->
130
+ <rect x="360" y="400" width="280" height="120" rx="6" fill="#2d3748" stroke="#68d391" stroke-width="1"/>
131
+ <text x="500" y="425" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" font-weight="bold" fill="#68d391">Kubernetes</text>
132
+
133
+ <text x="380" y="450" font-family="monospace" font-size="10" fill="#f6e05e"># deployment.yaml</text>
134
+ <text x="380" y="465" font-family="monospace" font-size="10" fill="#e0e0e0">apiVersion: apps/v1</text>
135
+ <text x="380" y="480" font-family="monospace" font-size="10" fill="#e0e0e0">kind: Deployment</text>
136
+ <text x="380" y="495" font-family="monospace" font-size="10" fill="#e0e0e0">replicas: 3</text>
137
+ <text x="380" y="510" font-family="monospace" font-size="10" fill="#e0e0e0">image: myapp/worker:latest</text>
138
+
139
+ <!-- Cloud Strategy -->
140
+ <rect x="670" y="400" width="280" height="120" rx="6" fill="#2d3748" stroke="#9f7aea" stroke-width="1"/>
141
+ <text x="810" y="425" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" font-weight="bold" fill="#9f7aea">Cloud Native</text>
142
+
143
+ <text x="690" y="450" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• AWS ECS/Fargate</text>
144
+ <text x="690" y="465" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Google Cloud Run</text>
145
+ <text x="690" y="480" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Azure Container Instances</text>
146
+ <text x="690" y="495" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Auto-scaling groups</text>
147
+ <text x="690" y="510" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Load balancer integration</text>
148
+ </g>
149
+
150
+ <!-- Scaling Considerations -->
151
+ <g>
152
+ <text x="500" y="570" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#e0e0e0">
153
+ Scaling Considerations
154
+ </text>
155
+
156
+ <!-- Horizontal Scaling -->
157
+ <rect x="80" y="590" width="180" height="80" rx="6" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
158
+ <text x="170" y="610" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#68d391">Horizontal Scaling</text>
159
+ <text x="90" y="630" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Add more worker instances</text>
160
+ <text x="90" y="645" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Queue-based load distribution</text>
161
+ <text x="90" y="660" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Stateless worker design</text>
162
+
163
+ <!-- RabbitMQ Scaling -->
164
+ <rect x="280" y="590" width="180" height="80" rx="6" fill="#1a202c" stroke="#2b6cb0" stroke-width="1"/>
165
+ <text x="370" y="610" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#2b6cb0">RabbitMQ Scaling</text>
166
+ <text x="290" y="630" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Clustering for HA</text>
167
+ <text x="290" y="645" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Queue sharding</text>
168
+ <text x="290" y="660" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Message routing optimization</text>
169
+
170
+ <!-- Resource Management -->
171
+ <rect x="480" y="590" width="180" height="80" rx="6" fill="#1a202c" stroke="#f6e05e" stroke-width="1"/>
172
+ <text x="570" y="610" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#f6e05e">Resource Management</text>
173
+ <text x="490" y="630" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Memory limits</text>
174
+ <text x="490" y="645" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• CPU resource allocation</text>
175
+ <text x="490" y="660" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Auto-scaling policies</text>
176
+
177
+ <!-- Monitoring -->
178
+ <rect x="680" y="590" width="180" height="80" rx="6" fill="#1a202c" stroke="#e53e3e" stroke-width="1"/>
179
+ <text x="770" y="610" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e53e3e">Monitoring</text>
180
+ <text x="690" y="630" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Queue depth monitoring</text>
181
+ <text x="690" y="645" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Processing time metrics</text>
182
+ <text x="690" y="660" font-family="Arial, sans-serif" font-size="10" fill="#e0e0e0">• Error rate tracking</text>
183
+ </g>
184
+
185
+ <!-- Connection arrows -->
186
+ <defs>
187
+ <marker id="arrow-scale" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
188
+ <polygon points="0 0, 8 3, 0 6" fill="#ff9800"/>
189
+ </marker>
190
+ </defs>
191
+
192
+ <!-- Connect patterns -->
193
+ <line x1="130" y1="160" x2="170" y2="160" stroke="#ff9800" stroke-width="1" marker-end="url(#arrow-scale)"/>
194
+ <line x1="250" y1="160" x2="200" y2="160" stroke="#68d391" stroke-width="1" marker-end="url(#arrow-scale)"/>
195
+ </svg>
@@ -0,0 +1,131 @@
1
+ <svg width="1000" height="700" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="1000" height="700" fill="transparent"/>
3
+
4
+ <!-- Title -->
5
+ <text x="500" y="30" text-anchor="middle" font-family="Arial, sans-serif" font-size="20" font-weight="bold" fill="#e0e0e0">
6
+ Smart Routing: Automatic Message Routing with Predictable Keys
7
+ </text>
8
+
9
+ <!-- Publisher Section -->
10
+ <g>
11
+ <text x="200" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#68d391">
12
+ Publisher
13
+ </text>
14
+
15
+ <!-- Message Classes -->
16
+ <rect x="50" y="100" width="140" height="80" rx="8" fill="#2d3748" stroke="#68d391" stroke-width="2"/>
17
+ <text x="120" y="125" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#68d391">OrderMessage</text>
18
+ <text x="60" y="145" font-family="monospace" font-size="10" fill="#e0e0e0">actions :validate,</text>
19
+ <text x="80" y="160" font-family="monospace" font-size="10" fill="#e0e0e0">:process, :ship</text>
20
+
21
+ <rect x="210" y="100" width="140" height="80" rx="8" fill="#2d3748" stroke="#68d391" stroke-width="2"/>
22
+ <text x="280" y="125" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#68d391">EmailMessage</text>
23
+ <text x="220" y="145" font-family="monospace" font-size="10" fill="#e0e0e0">actions :send,</text>
24
+ <text x="240" y="160" font-family="monospace" font-size="10" fill="#e0e0e0">:schedule</text>
25
+
26
+ <!-- Publishing -->
27
+ <rect x="90" y="200" width="200" height="60" rx="8" fill="#1a202c" stroke="#4299e1" stroke-width="1"/>
28
+ <text x="190" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#4299e1">Publishing</text>
29
+ <text x="100" y="240" font-family="monospace" font-size="10" fill="#e0e0e0">message.publish('process')</text>
30
+ <text x="100" y="255" font-family="monospace" font-size="10" fill="#e0e0e0">message.publish('send')</text>
31
+ </g>
32
+
33
+ <!-- Routing Key Generation -->
34
+ <g>
35
+ <text x="500" y="320" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#ff9800">
36
+ Automatic Routing Key Generation
37
+ </text>
38
+
39
+ <!-- Pattern Formula -->
40
+ <rect x="350" y="340" width="300" height="80" rx="8" fill="#2d3748" stroke="#ff9800" stroke-width="2"/>
41
+ <text x="500" y="365" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#ff9800">Routing Key Pattern</text>
42
+ <text x="500" y="385" text-anchor="middle" font-family="monospace" font-size="16" fill="#e0e0e0">MessageClassName.action</text>
43
+ <text x="500" y="405" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#9ca3af">Predictable • Transparent • Debuggable</text>
44
+
45
+ <!-- Examples -->
46
+ <rect x="100" y="450" width="200" height="120" rx="8" fill="#1a202c" stroke="#68d391" stroke-width="1"/>
47
+ <text x="200" y="475" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#68d391">Order Messages</text>
48
+ <text x="110" y="495" font-family="monospace" font-size="10" fill="#e0e0e0">OrderMessage.validate</text>
49
+ <text x="110" y="510" font-family="monospace" font-size="10" fill="#e0e0e0">OrderMessage.process</text>
50
+ <text x="110" y="525" font-family="monospace" font-size="10" fill="#e0e0e0">OrderMessage.ship</text>
51
+ <text x="110" y="540" font-family="monospace" font-size="10" fill="#e0e0e0">OrderMessage.cancel</text>
52
+ <text x="110" y="555" font-family="monospace" font-size="10" fill="#e0e0e0">OrderMessage.complete</text>
53
+
54
+ <rect x="320" y="450" width="200" height="120" rx="8" fill="#1a202c" stroke="#4299e1" stroke-width="1"/>
55
+ <text x="420" y="475" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#4299e1">Email Messages</text>
56
+ <text x="330" y="495" font-family="monospace" font-size="10" fill="#e0e0e0">EmailMessage.send</text>
57
+ <text x="330" y="510" font-family="monospace" font-size="10" fill="#e0e0e0">EmailMessage.schedule</text>
58
+ <text x="330" y="525" font-family="monospace" font-size="10" fill="#e0e0e0">EmailMessage.cancel</text>
59
+ <text x="330" y="540" font-family="monospace" font-size="10" fill="#e0e0e0">EmailMessage.retry</text>
60
+ <text x="330" y="555" font-family="monospace" font-size="10" fill="#e0e0e0">EmailMessage.bounce</text>
61
+
62
+ <rect x="540" y="450" width="200" height="120" rx="8" fill="#1a202c" stroke="#9f7aea" stroke-width="1"/>
63
+ <text x="640" y="475" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#9f7aea">Report Messages</text>
64
+ <text x="550" y="495" font-family="monospace" font-size="10" fill="#e0e0e0">ReportMessage.generate</text>
65
+ <text x="550" y="510" font-family="monospace" font-size="10" fill="#e0e0e0">ReportMessage.email</text>
66
+ <text x="550" y="525" font-family="monospace" font-size="10" fill="#e0e0e0">ReportMessage.archive</text>
67
+ <text x="550" y="540" font-family="monospace" font-size="10" fill="#e0e0e0">ReportMessage.schedule</text>
68
+ <text x="550" y="555" font-family="monospace" font-size="10" fill="#e0e0e0">ReportMessage.cleanup</text>
69
+ </g>
70
+
71
+ <!-- RabbitMQ Exchange -->
72
+ <g>
73
+ <text x="800" y="320" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#2b6cb0">
74
+ RabbitMQ Topic Exchange
75
+ </text>
76
+
77
+ <rect x="720" y="340" width="160" height="100" rx="8" fill="#1a365d" stroke="#2b6cb0" stroke-width="2"/>
78
+ <text x="800" y="365" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#90cdf4">Exchange</text>
79
+ <text x="800" y="385" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#bee3f8">Topic Routing</text>
80
+ <text x="800" y="405" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#bee3f8">Pattern Matching</text>
81
+ <text x="800" y="425" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#bee3f8">Flexible Bindings</text>
82
+ </g>
83
+
84
+ <!-- Queue Bindings -->
85
+ <g>
86
+ <text x="500" y="610" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#e0e0e0">
87
+ Queue Binding Patterns
88
+ </text>
89
+
90
+ <!-- Single message type -->
91
+ <rect x="50" y="630" width="180" height="60" rx="8" fill="#2d3748" stroke="#68d391" stroke-width="1"/>
92
+ <text x="140" y="650" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#68d391">Order Worker</text>
93
+ <text x="60" y="665" font-family="monospace" font-size="10" fill="#e0e0e0">OrderMessage.*</text>
94
+ <text x="60" y="680" font-family="Arial, sans-serif" font-size="9" fill="#9ca3af">All order operations</text>
95
+
96
+ <!-- Specific action -->
97
+ <rect x="250" y="630" width="180" height="60" rx="8" fill="#2d3748" stroke="#4299e1" stroke-width="1"/>
98
+ <text x="340" y="650" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#4299e1">Validation Worker</text>
99
+ <text x="260" y="665" font-family="monospace" font-size="10" fill="#e0e0e0">*.validate</text>
100
+ <text x="260" y="680" font-family="Arial, sans-serif" font-size="9" fill="#9ca3af">All validation actions</text>
101
+
102
+ <!-- Priority queue -->
103
+ <rect x="450" y="630" width="180" height="60" rx="8" fill="#2d3748" stroke="#f6e05e" stroke-width="1"/>
104
+ <text x="540" y="650" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#f6e05e">Urgent Queue</text>
105
+ <text x="460" y="665" font-family="monospace" font-size="10" fill="#e0e0e0">UrgentMessage.*</text>
106
+ <text x="460" y="680" font-family="Arial, sans-serif" font-size="9" fill="#9ca3af">High priority messages</text>
107
+
108
+ <!-- Catch all -->
109
+ <rect x="650" y="630" width="180" height="60" rx="8" fill="#2d3748" stroke="#9f7aea" stroke-width="1"/>
110
+ <text x="740" y="650" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#9f7aea">General Worker</text>
111
+ <text x="660" y="665" font-family="monospace" font-size="10" fill="#e0e0e0">#</text>
112
+ <text x="660" y="680" font-family="Arial, sans-serif" font-size="9" fill="#9ca3af">All messages</text>
113
+ </g>
114
+
115
+ <!-- Flow Arrows -->
116
+ <defs>
117
+ <marker id="arrow-routing" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
118
+ <polygon points="0 0, 10 3.5, 0 7" fill="#ff9800"/>
119
+ </marker>
120
+ </defs>
121
+
122
+ <!-- Publisher to Exchange -->
123
+ <line x1="290" y1="240" x2="720" y2="380" stroke="#ff9800" stroke-width="3" marker-end="url(#arrow-routing)"/>
124
+ <text x="450" y="280" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" fill="#ff9800" transform="rotate(-15 450 280)">Routing Keys</text>
125
+
126
+ <!-- Exchange to Queues -->
127
+ <line x1="750" y1="450" x2="140" y2="620" stroke="#ff9800" stroke-width="2" marker-end="url(#arrow-routing)"/>
128
+ <line x1="800" y1="450" x2="340" y2="620" stroke="#ff9800" stroke-width="2" marker-end="url(#arrow-routing)"/>
129
+ <line x1="830" y1="450" x2="540" y2="620" stroke="#ff9800" stroke-width="2" marker-end="url(#arrow-routing)"/>
130
+ <line x1="850" y1="450" x2="740" y2="620" stroke="#ff9800" stroke-width="2" marker-end="url(#arrow-routing)"/>
131
+ </svg>