Overview
The Custom Language Service is a demonstration microservice that processes invocation requests and returns customized responses. It supports error simulation for testing different HTTP status codes and records all executions to a database.Base URL
Endpoints
Health Check
200- Service is healthy503- Database health check failed
Invoke Service
Name to include in the greeting message. Special values trigger error responses for testing purposes.
Greeting message (only present on successful 200 responses)
Error description (only present on error responses)
200- Success401- Unauthorized (triggered by name=“unauthorized”)403- Forbidden (triggered by name=“forbidden”)404- Not Found (triggered by name=“notfound”)409- Conflict (triggered by name=“conflict”)429- Rate Limited (triggered by name=“ratelimit”)503- Service Unavailable (triggered by name=“unavailable”)
Special Testing Values
The/invoke endpoint includes built-in error simulation for testing various HTTP status codes. Use these special name values to trigger specific error responses:
| Name Value | Status Code | Error Message |
|---|---|---|
unauthorized | 401 | unauthorized |
forbidden | 403 | forbidden |
notfound | 404 | not found |
conflict | 409 | conflict |
ratelimit | 429 | rate limited |
unavailable | 503 | service unavailable |
Usage Examples
Successful Invocation
Default Name
Error Simulation - Unauthorized
Error Simulation - Rate Limit
Error Simulation - Service Unavailable
Database Recording
All invocations are recorded to the database (when configured) with the following information:- name - The name parameter from the request
- result_message - The greeting message (null for errors)
- status_code - The HTTP status code returned
Error Handling
Error responses follow a consistent format:401- Unauthorized403- Forbidden404- Not Found409- Conflict429- Too Many Requests503- Service Unavailable (health check failure or simulated error)
Notes
- Content Type: All requests must include
Content-Type: application/jsonheader - Database: The service operates with or without database configuration. Failed database operations are logged but don’t interrupt request processing
- Type Coercion: The
nameparameter is converted to a string using.toString() - Testing: Special name values are designed for integration testing and error handling verification
- Execution History: When the database is configured, all invocations are stored in the
executionstable for auditing and analytics