Hello, everyone!
I’m excited to share my simple integration tool with you: Postman4j-Interceptors. If you’re a Java developer working with APIs, debugging, or troubleshooting Spring-based web servers and microservices, this tool is here to make your life easier: simplify debugging and testing your java applications with Postman.
What Problem Does It Solve?
The API-first approach has become a standard in modern application development. Tools like Postman are invaluable for generating collections from API specs and debugging HTTP communication in microservices. But what if you need to retry, reproduce, or manually execute requests made by your Java application for debugging purposes?
Currently, you can use pre-generated Postman collections for this. However, setting them up often involves manually filling in variables and replicating the application’s behavior. Postman4j-Interceptors simplifies this process by automatically logging your application’s HTTP requests into a Postman collection. This means you can easily reuse these requests without the hassle of manual setup: for example when http requests was failed inside your application for some cases.
Current Features
- Supports Interceptors for:
- Apache HttpClient 5 (as a client)
- Spring Web (as a server)
- restassured (as client) - is currently under construction
- Key Capabilities:
- Intercept HTTP request chains for debugging or testing.
- Save only the information you need, directly in-memory (available to download collections from actuator endpoint for spring).
- Seamlessly log and export the data as a Postman collection.
How to Get Started
You can find Postman4j-Interceptors source on GitHub or get library from maven central. Just add library with gradle or maven, create your interceptor object with necessary options and mark required functions with annotations. Detailed information with setup and installation your could find in project readme. Demo with installation for spring project is available here.
Please try it out and share your feedback on this tool - do you find it useful? Which clients or servers would you like to see supported?
Feel free to share your thoughts, open issues for enhancement requests, and star the github project if you find it helpful. Your input is greatly appreciated!
Let me know what you think!