Hello NestForge Microservices
What the microservices example includes and how it demonstrates pattern dispatch without a network transport.
Example purpose
Section titled “Example purpose”This example demonstrates NestForge’s transport-neutral microservice layer without requiring HTTP, gRPC, or WebSockets at the edge.
Files included
Section titled “Files included”The example currently includes:
src/main.rssrc/app_module.rssrc/app_config.rssrc/microservices/mod.rssrc/microservices/patterns.rs
What each file does
Section titled “What each file does”src/main.rs
Section titled “src/main.rs”Creates a testing module with TestFactory::<AppModule>, resolves the pattern registry,
constructs an in-process microservice client, sends a message, emits an event, prints the
result, and shuts the module down.
This is important because it demonstrates that the microservice layer is not tied to a specific external server.
src/app_module.rs
Section titled “src/app_module.rs”Registers:
AppConfigAppPatternsEventCounter
and exports them for the microservice runtime.
src/microservices/patterns.rs
Section titled “src/microservices/patterns.rs”Defines:
GreetingPayloadEventCounter- the
app.greetmessage pattern - the
app.bumpevent pattern
What users learn from this example
Section titled “What users learn from this example”- how to define message and event patterns
- how handlers resolve providers from
MicroserviceContext - how to test microservice workflows in-process
- how stateful side effects such as event counters can still use DI-managed providers