When HTTP handling and business rules become tangled, changing the delivery mechanism can force changes throughout the application. A driving adapter, also called a primary or input adapter, keeps that boundary explicit: it receives an external trigger and translates it into a call to an application input port. It lives outside the hexagon and depends inward on core-owned contracts. section 1.1 section 4.1.1
A driving adapter handles delivery decisions such as HTTP verbs, response shapes, and message headers. Business rules and use-case orchestration belong in the core, not in the adapter. The adapter should depend on the input interface rather than the concrete handler. section 2.3.2 section 4.1.1 section 5.1.1
A typical adapter performs three translations:
- Receive a request in the delivery mechanism’s format, such as an HTTP body, message payload, or command-line argument. section 5.1.1
- Construct a command or query and dispatch it to the application, directly through an input port or through a bus. section 4.1.1 section 5.1
- Translate the result into the expected response, acknowledgement, or console output, including protocol-specific error responses. section 5.1.1 section 5.5
REST controller and message consumer
A REST controller can turn an article request into a command and send it through the command bus; a message consumer can trigger the same use case through the same bus. The handler and domain model remain unchanged. Framework annotations stay in the adapters rather than the core. section 5.1 section 5.1.1 section 5.5
Figure 5.2 Two input adapters, one use case. The REST controller and the message consumer both call the same command bus. The handler behind the bus is identical regardless of which adapter triggered it.
The diagram traces a REST controller and a message consumer through the same bus to one handler. section 5.1.1
Test a controller by mocking its bus and error handler. Configure a success or failure result, call the controller, and assert the response status and body as well as the expected interactions. Boundary checks can also enforce inward adapter dependencies. section 8.5 section 9.5

