Claude Codeでコンテンツベースルーティングを設計する:ペイロード内容によるメッセージ振り分け・動的ルーティング

はじめに 「メッセージのペイロード内容によって送り先を変えたい」「高額注文は優先Workerへ、通常注文は通常Workerへ」——コンテンツベースルーティングで、メッセージの内容を評価して動的に送り先を決定する設計をClaude Codeに生成させる。 CLAUDE.mdにコンテンツベースルーティング設計ルールを書く ## コンテンツベースルーティング設計ルール ### ルーティングルール ...

By · · 1 min read
Claude Codeでコンテンツベースルーティングを設計する:ペイロード内容によるメッセージ振り分け・動的ルーティング

Source: DEV Community

はじめに 「メッセージのペイロード内容によって送り先を変えたい」「高額注文は優先Workerへ、通常注文は通常Workerへ」——コンテンツベースルーティングで、メッセージの内容を評価して動的に送り先を決定する設計をClaude Codeに生成させる。 CLAUDE.mdにコンテンツベースルーティング設計ルールを書く ## コンテンツベースルーティング設計ルール ### ルーティングルール - ルールはコードではなく設定として外部化(DB/Redis) - ルール評価は高速(JSONPathまたはシンプルな条件式) - デフォルトルート: どのルールにも一致しない場合の送り先 ### ルーティング先の種類 - キュー名(Redis Stream/RabbitMQ Exchange) - サービスエンドポイント(HTTP POST) - 複数送り先(Fanout的な複数ルート) ### 動的ルール更新 - ルールのホットリロード(再起動不要) - ルール変更はRedisキャッシュを即座に無効化 - ルール評価のテスト機能(test modeでメッセージを渡してルートを確認) コンテンツベースルーティング実装の生成 コンテンツベースルーティングシステムを設計してください。 要件: - 設定ベースのルーティングルール - JSONPathによるペイロード評価 - 動的ルール更新 - ルーティングログ 生成ファイル: src/messaging/routing/ 生成されるコンテンツベースルーティング実装 // src/messaging/routing/contentRouter.ts — コンテンツベースルーター export type RouteCondition = | { type: 'field_equals'; field: string; value: unknown } | { type: 'field_greater_than'; field: string; value: number } | { type: 'field_in'; field: string; values: unknown[] } | { type: 'field_exists'; field: string } | { type: 'regex'; field: string;

Related Posts

Similar Topics

#ai (18)#feat (17)#fix (17)#webdev (14)#javascript (13)#chore (9)#opensource (8)#large language models (4)#modernization (6)#css (6)#backbonejs (6)#es6 (6)#redis (2)#security (5)#nextjs (5)#programming (5)#code generation (4)#api (4)#node (4)#html (4)

Trending on ShareHub

  1. Understanding Modern JavaScript Frameworks in 2026
    by Alex Chen · Feb 12, 2026 · 0 likes
  2. The System Design Primer
    by Sarah Kim · Feb 12, 2026 · 0 likes
  3. Just shipped my first open-source project!
    by Alex Chen · Feb 12, 2026 · 0 likes
  4. OpenAI Blog
    by Sarah Kim · Feb 12, 2026 · 0 likes
  5. Building Accessible Web Applications: A Practical Guide
    by Alex Chen · Feb 12, 2026 · 0 likes
  6. Rapper Lil Poppa dead at 25, days after releasing new music
    Rapper Lil Poppa dead at 25, days after releasing new music
    by Anonymous User · Feb 19, 2026 · 0 likes
  7. write-for-us
    by Volt Raven · Mar 7, 2026 · 0 likes
  8. Before the Coffee Gets Cold: Heartfelt Story of Time Travel and Second Chances
    Before the Coffee Gets Cold: Heartfelt Story of Time Travel and Second Chances
    by Anonymous User · Feb 12, 2026 · 0 likes
    #coffee gets cold #the #time travel
  9. Best DoorDash Promo Code Reddit Finds for Top Discounts
    Best DoorDash Promo Code Reddit Finds for Top Discounts
    by Anonymous User · Feb 12, 2026 · 0 likes
    #doordash #promo #reddit
  10. Premium SEO Services That Boost Rankings & Revenue | VirtualSEO.Expert
    by Anonymous User · Feb 12, 2026 · 0 likes
  11. NBC under fire for commentary about Team USA women's hockey team
    NBC under fire for commentary about Team USA women's hockey team
    by Anonymous User · Feb 18, 2026 · 0 likes
  12. Where to Watch The Nanny: Streaming and Online Viewing Options
    Where to Watch The Nanny: Streaming and Online Viewing Options
    by Anonymous User · Feb 12, 2026 · 0 likes
    #streaming #the nanny #where
  13. How Much Is Kindle Unlimited? Subscription Cost and Plan Details
    How Much Is Kindle Unlimited? Subscription Cost and Plan Details
    by Anonymous User · Feb 12, 2026 · 0 likes
    #kindle unlimited #subscription #unlimited
  14. Russian skater facing backlash for comment about Amber Glenn
    Russian skater facing backlash for comment about Amber Glenn
    by Anonymous User · Feb 18, 2026 · 0 likes
  15. Google News
    Google News
    by Anonymous User · Feb 18, 2026 · 0 likes

Latest on ShareHub

Browse Topics

#artificial intelligence (31559)#data science (24017)#ai (16792)#generative ai (15034)#crypto (14995)#machine learning (14680)#bitcoin (14234)#featured (13554)#news & insights (13064)#crypto news (11083)

Around the Network