3AS Dispatcher Service

A fire-and-forget message forwarding service that dispatches entire request bodies to endpoints specified in headers while maintaining protocol context.

Next.js 15App RouterTypeScriptRedisConversation Management
๐Ÿš€ Dispatch Endpoint
Enhanced with conversation management

POST

/api/dispatch

Fire-and-forget forwarding with intelligent conversation flow control

+ Conversation headers support
๐Ÿ’ฌ Conversations API
Manage conversation states and limits

GET

/api/conversations

List all conversations with status and message counts

+ Stop/pause/resume actions
๐Ÿ“Š Dashboard
Real-time conversation monitoring

Monitor conversation status, message counts, and manage flows

๐Ÿงช Test Endpoint
Local endpoint for testing the dispatcher

POST

/api/test-receiver

Receives and acknowledges dispatched messages

๐Ÿ“ˆ Service Info
Get dispatcher endpoint information

GET

/api/dispatch

Returns service metadata and usage examples

๐Ÿ“ Basic Dispatch Example
Standard message forwarding without conversation management
curl -X POST http://localhost:3999/api/dispatch \
  -H "Content-Type: application/json" \
  -H "X-Forward-Endpoint: http://localhost:3999/api/test-receiver" \
  -H "X-3AS-Session-ID: session-123" \
  -H "X-3AS-Protocol-Version: 1.0" \
  -d '{
    "type": "greeting",
    "content": "Hello from dispatcher!",
    "priority": "high"
  }'
๐Ÿ’ฌ Conversation Management Example
Enhanced dispatch with conversation flow control
curl -X POST http://localhost:3999/api/dispatch \
  -H "Content-Type: application/json" \
  -H "X-Forward-Endpoint: http://localhost:3999/api/test-receiver" \
  -H "x-3as-conversation-id: conv-12345" \
  -H "x-3as-user-cdid: user-abc123" \
  -H "x-3as-sender-cdid: bot-service" \
  -d '{
    "message": "Hello! How can I help you?",
    "type": "bot_message"
  }'

โœจ Automatically tracks message count and manages conversation flow

๐Ÿ“‹ Forwarded Request
What the target endpoint receives

Headers:

X-Dispatcher-Endpoint: http://localhost:3000/api/dispatch
X-3AS-Session-ID: session-123
X-3AS-Protocol-Version: 1.0
Content-Type: application/json

Body (entire original body forwarded):

{
  "type": "greeting",
  "content": "Hello from dispatcher!",
  "priority": "high",
  "metadata": {
    "sender": "client-app",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}
๐Ÿ”ง Key Features
What makes this dispatcher service unique
๐Ÿ”„

Body Forwarding

Forwards entire request body unchanged to any HTTP endpoint

๐Ÿ’ฌ

Conversation Management

Intelligent message counting and flow control with Redis

๐Ÿ“Š

Real-time Dashboard

Monitor conversations, status, and manage flows visually

โšก

Fast & Reliable

Built on Next.js 15 with TypeScript and Redis