Lesson 2 Complete Solution

This folder contains the complete solution for Lesson 2: Kotlin + Spring Boot + Temporal Setup.

What's Included

  • TemporalStarterApplication.kt - Spring Boot main class
  • config/TemporalConfig.kt - Complete Temporal configuration with:
    • Connection to local Temporal server
    • Workflow client setup
    • Worker factory configuration
    • Basic worker that connects to a test queue

How It Works

  1. WorkflowServiceStubs - Connects to Temporal server (localhost:7233 by default)
  2. WorkflowClient - Provides the interface to start workflows and interact with Temporal
  3. WorkerFactory - Creates and manages workers that execute workflows and activities
  4. Worker - Listens to a specific task queue for work to execute

Running This Solution

Make sure you have Temporal server running locally (see Lesson 3), then you should see output like:

✅ Temporal worker started successfully! Connected to local Temporal server.

Key Learning Points

  • Temporal configuration uses Spring beans for dependency injection
  • Workers must be started after configuration is complete
  • Graceful shutdown ensures workers stop cleanly
  • The worker factory manages multiple workers efficiently

Next Steps

In Lesson 3, we'll learn how to run Temporal server locally and see this connection in action!

results matching ""

    No results matching ""