Skip to content

Using Inspectr with Java Spring

Inspectr works seamlessly with Java Spring Boot applications, making it easy to debug API calls, inspect HTTP traffic, and expose your local service to the internet for webhook testing or integration with external systems.

This guide walks you through running Inspectr in front of a Spring Boot API.


  • Java 17+ and Maven installed
  • A Spring Boot project (e.g. using Spring Initializr)
  • Inspectr installed (Install guide →)

You can quickly create a new Spring Boot app:

Terminal window
curl https://start.spring.io/starter.zip \
-d dependencies=web \
-d name=DemoApi \
-o demo.zip
unzip demo.zip && cd DemoApi
./mvnw spring-boot:run

By default, Spring Boot listens on:

http://localhost:8080

To avoid conflicts with Spring Boot’s default port, run Inspectr on a different port and forward to your Spring backend:

Terminal window
inspectr --listen=:8181 --backend=http://localhost:8080

Now you can access your Spring API via Inspectr at:

http://localhost:8181

Example:

Terminal window
curl http://localhost:8181/api/hello

All traffic will be logged and shown in the Inspectr App at http://localhost:4004.


Optional: Expose Your Spring Boot API Publicly

Section titled “Optional: Expose Your Spring Boot API Publicly”

Run Inspectr with Ingress enabled to expose your API to external services:

Terminal window
inspectr \
--listen=:8181 \
--backend=http://localhost:8080 \
--expose \
--channel=spring-demo \
--channel-code=spring123

Your API will now be available at:

https://spring-demo.in-spectr.dev

  • View requests/responses in real time
  • Replay requests to your Spring controllers
  • Capture external events (e.g., webhooks) and forward them into your API

With Inspectr and Spring Boot, you can:

  • Debug and inspect HTTP traffic between clients and your backend
  • Safely expose your local API for integration testing
  • Replay traffic and simulate events using the Inspectr App