# Spring Boot example with REST and Kafka Streams

**URL:** <https://forum.confluent.io/t/spring-boot-example-with-rest-and-kafka-streams/420>\
**Category:** Kafka Streams\
**Created:** [14 January 2021 16:33 UTC](https://forum.confluent.io/t/spring-boot-example-with-rest-and-kafka-streams/420 "2021-01-14T16:33:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rick](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/rick/32/49_2.png) [@rick](https://forum.confluent.io/u/rick)\
**Post date:** [14 January 2021 16:33 UTC](https://forum.confluent.io/t/spring-boot-example-with-rest-and-kafka-streams/420/1 "2021-01-14T16:33:14Z")

</div>

If you’re looking to build a REST service with integrations into Kafka Streams, check out this example which is part of a [broader DevOps project](https://docs.confluent.io/platform/current/tutorials/kafka-devops/index.html) over at Confluent.

> **[streaming-ops/apps/microservices-orders/orders-service at main ·...](https://github.com/confluentinc/streaming-ops/tree/main/apps/microservices-orders/orders-service)**
>
> main/apps/microservices-orders/orders-service

It includes an [example REST Service](https://github.com/confluentinc/kafka-devops/blob/d09b23dd2cbb4158186dfec67cb43b3cabf6e3c8/apps/microservices-orders/orders-service/src/main/java/io/confluent/kafkadevops/microservicesorders/ordersservice/OrdersServiceController.java), which is super easy in Spring Boot using Java annotations:

```
@GetMapping(value = "/orders/{id}",
produces = "application/json")
public DeferredResult<ResponseEntity<Order>> getOrder(@PathVariable String id, @RequestParam Optional<Long> timeout)

```

And a [Streams Topology](https://github.com/confluentinc/kafka-devops/blob/d09b23dd2cbb4158186dfec67cb43b3cabf6e3c8/apps/microservices-orders/orders-service/src/main/java/io/confluent/kafkadevops/microservicesorders/ordersservice/OrdersProcessor.java) which is crazy simple with Dependency Injection provided by Spring Boot

```
@Autowired
public void orderTable(final StreamsBuilder builder) {

```

Also there is an [example of how you could use standard Java / Kafka properties files](https://github.com/confluentinc/kafka-devops/blob/d09b23dd2cbb4158186dfec67cb43b3cabf6e3c8/apps/microservices-orders/orders-service/src/main/resources/application.properties) to configuration the application using the Spring configuration reference syntax…

```
# Spring Kafka
spring.kafka.properties.bootstrap.servers=${bootstrap.servers}

```
