---
title: "Temporal for Java/Spring Boot Microservices"
description: "This project experiments with applying Temporal to the implementation of Java/Spring Boot microservices."
canonical: "https://temporal.io/code-exchange/temporal-for-java-spring-boot-microservices.md"
source: "https://temporal.io/code-exchange/temporal-for-java-spring-boot-microservices"
published: "2025-03-10"
authors:
  - "Cornelia Davis"
company: "Temporal"
languages:
  - "Java"
tags:
  - "Example Application"
  - "Experimental"
  - "Spring"
  - "Spring Boot"
reviewed_by_temporal: false
community_contribution: true
---

# Temporal for Java/Spring Boot Microservices

This project experiments with applying Temporal to the implementation of Java/Spring Boot microservices.

- [View repo](https://github.com/cdavisafc/cloudnativepatterns/tree/main/cloudnative-statelessness-temporal)
- [Read the article](https://medium.com/@cdavisafc/applying-temporal-to-request-response-microservices-4312ad59b165)
- [Read the article](https://medium.com/@cdavisafc/spring-boot-and-temporal-3840114fc341)

A typical approach to implementing microservices in Java with Spring Boot places business logic within a REST controller. If the microservice makes downstream requests - which for better or worse are often implemented in a request/response style - the implementation must include code that compensates for sporadic failures. Of course, this is exactly in Temporal's sweet spot.

This project experiments with applying Temporal to the implementation of Java/Spring Boot microservices, addressing things such as retries, as well as dependency management/injection, and packaging of deployable artifacts. The project's git repository is accompanied by the following blog posts:
* [Applying Temporal to Request/Response Microservices](https://medium.com/@cdavisafc/applying-temporal-to-request-response-microservices-4312ad59b165)
* [Spring Boot and Temporal](https://medium.com/@cdavisafc/spring-boot-and-temporal-3840114fc341)
  - An [addendum](https://medium.com/@cdavisafc/temporal-activities-as-spring-beans-an-addendum-f9f72418cd79) that shows how to make Temporal activities Spring Beans; this allows for things like dependency injection.

__Application Topology Diagram__

![Code Exchange - Microservices and Spring Boot Diagram](https://images.ctfassets.net/0uuz8ydxyd9p/45Vdk5TvrPHTiUfCmx0Fiu/94b97a405cdc26deb61cc2a22dc1bc51/CNPExampleRequestResponse.png)
