Open-source Java framework · Moduliths & microservices

Separate what a service does from how it is governed.

Chenile lets you write plain-Java services that hold nothing but business logic — then apply security, logging, tenancy, i18n and retries as reusable service policies, consistently at the API gateway and the last mile.

org.chenile · v2.1.37 · 11 repositories, one release train
0
Modular repositories
One coherent framework, versioned together
0K
Lines of production Java
Plus ~21K lines of tests
0
Automated framework tests
Plus 22 in JGen · zero failures on 2.1.31
0
Maven modules
Released together under chenile-parent
0×
Write a policy once
Runs at the gateway and the last mile

Measured from the source — see Chenile by the numbers →

How it works

One service, many transports

Define a service once. HTTP, proxies, AI agents over MCP, Kafka, MQTT, Azure Event Hubs, schedules and file drops all reach it through a transport adapter, and every adapter hands off to the same ChenileEntryPoint. Your policies run once, in one place, whatever the caller.

Chenile services exposed via multiple transports HTTP clients, local Chenile proxies, AI agents over MCP, pub-sub brokers (Kafka, Azure Event Hub, MQTT, JVM pub-sub) and triggers (cron, file watcher, external HTTP) reach transport adapters (ControllerSupport, HttpEntryPoint, LocalProxyInvoker, ChenileMCP, PubSubEntryPoint for @ChenilePubSub invocations, EventProcessor for Chenile events), which all hand off to ChenileEntryPoint and the chenile-highway interceptor chain before the registered services are invoked. A remote proxy becomes an HTTP client of the service. A Spring RestController sits in the request path; a non-REST ChenileController only supplies the definition at startup. HTTP client HTTP client Chenile proxy AI agent (MCP) Kafka Azure Event Hub MQTT JVM pub-sub Cron File watcher Ext HTTP trigger @RestControllerSpring · in the request path @ChenileControllerdefinition only · not in path Spring MVC route registers routes at startup local MCP tool call remote: becomes an HTTP client Pub-sub consumerschenile-messaging Trigger servicemode: outbox Chenile transport adapters ControllerSupportprocess(...) HttpEntryPointannotation and JSON routes LocalProxyInvokerChenile proxy · local ChenileMCPtool callback PubSubEntryPoint@ChenilePubSub invocation EventProcessorhandleEvent(id, …) Outboxrows: 0 ChenileEntryPoint chenile-highway headers pre-proc transform svc-ref post-proc invoke Service Acalls: 0 Service Bcalls: 0
Send
Trigger mode
Watching traffic…

Click any box to see what it is and where to read more.

Walk through every adapter →

The core move

Business logic in one module. Everything else, out.

✅ s1-api — the definition

What consumers depend on. Pure contract.

  • The service interface (S1Service)
  • The model objects
  • No implementation, no transport, no Spring
  • Packaged as a library — never deployed alone

⚙️ s1-service — the implementation

What nobody depends on. Swappable.

  • A plain POJO implementing the interface
  • A health checker for deep readiness probes
  • Wired through a Chenile controller
  • Horizontal concerns handled by policies, not code
// The whole service. Business logic and nothing else —
// no auth, no logging, no tenancy checks tangled in here.
public class S1ServiceImpl implements S1Service {
    @Override
    public S1Entity op1(S1Entity s1Entity) {
        s1Entity.id = "S1ServiceImpl";
        return s1Entity;               // policies run around this, not inside it
    }
}
Write once, run in two places

One policy model — the gateway and the last mile

Chenile's interceptor abstraction is the same whether it runs at the edge or beside the service. The service registry decides where each policy applies.

Chenile runtime diagram: a request flows through the API gateway into a service, becomes a ChenileExchange, and runs through the interception pipeline of policies before reaching pure business logic — the same interceptor contract at the gateway and the last mile.
🛡️

At the API gateway

Terminate authentication, coarse authorization, rate-limiting and request normalization at the edge — so bad traffic never reaches your services. Chenile ships an auth gateway and resource-server starters in chenile-security.

🎯

At the last mile

Fine-grained authorization, multi-tenancy, i18n, idempotency and business-aware logging run inside each service's interception pipeline — where the domain context actually exists. Same interceptor contract, different deployment.

See how placement works →

Testing, the same way

One Gherkin spec. A unit test and an integration test.

Chenile ships the same step vocabulary in two libraries — so a single .feature file runs in-process over Spring MockMvc and against a live server over REST Assured.

One Gherkin feature file branches to a unit test using cucumber-utils over Spring MockMvc and an integration test using it-cucumber-utils over REST Assured. Swap the glue, not the spec.
🧪

Unit / component — cucumber-utils

Spring MockMvc stands the service up in an ephemeral in-process instance and drives it from the outside. Because the request passes through the real Chenile pipeline, it exercises the service and its interceptors — governance is under test. Fast enough for every build.

🌐

Integration — it-cucumber-utils · chenile-bdd

The identical scenarios run over REST Assured against a really deployed server, verifying the wire, packaging, config and environment. it-cucumber-sec-utils does the same for secured endpoints. Same spec, run against staging.

How BDD reuse works →

Coming soon

AI, governed by Chenile.

Chenile already knows your services, their contracts, their workflows and their metrics. ChenAIle puts AI to work on all of it.

01

ChenAIle agents

AI agents that act through governed Chenile services and workflows, under the same policies as every other caller. Powered by Chenile Finito.

02

ChenAIle tool calls

Chenile services as MCP tools, governed by the same pipeline as every other caller. Tool calls through the entry point ship in 2.1.36; a tool registry follows.

03

ChenAIle machine learning

AI-based machine learning on the signals Chenile services already produce.

04

Business rules engine

A rules engine that leverages the metrics coming from Chenile services to drive business decisions.

Generate your first Chenile service in minutes

Scaffold an api + service pair, get a deployable monolith, and start attaching policies.