https://github.com/olle/query-response-spring-amqp
Fluid and safe API for Query/Response with Spring AMQP.
https://github.com/olle/query-response-spring-amqp
async consumers fluid java messaging publishers query-response rabbitmq spring-amqp
Last synced: 4 months ago
JSON representation
Fluid and safe API for Query/Response with Spring AMQP.
- Host: GitHub
- URL: https://github.com/olle/query-response-spring-amqp
- Owner: olle
- License: apache-2.0
- Created: 2019-12-14T13:21:19.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-12-02T09:51:13.000Z (6 months ago)
- Last Synced: 2025-12-05T05:47:34.923Z (6 months ago)
- Topics: async, consumers, fluid, java, messaging, publishers, query-response, rabbitmq, spring-amqp
- Language: Java
- Homepage: https://olle.github.io/query-response-spring-amqp/
- Size: 49.1 MB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Query/Response for Spring® AMQP
image:https://github.com/olle/spring-query-response-amqp/workflows/Java%20CI/badge.svg[title="Java CI", link="https://github.com/olle/query-response-spring-amqp/actions?query=workflow%3A%22Java+CI%22"]
**WIP: Driving the initial version from this README, please feel free to
provide feedback through issues.**
Build safer and more resilient distributed services. Get the benefits of an
_always async_ approach to data exchange. Ensure decoupling of components. Be
better prepared for system evolution. Create more scalable solutions. Change the
way you think and design, by using Query/Response for Spring AMQP.
== Batteries, included
Query/Response provides tools to allow developers to monitor, measure, explore
and discover the capabilities of their runtime system. Metrics and interactive
utilities, built-in. See link:./ui/[ui] for more information.
image:ui/ui.png[]
== Quickstart
The Query/Response library can easily be added to any Spring Boot® project, as
a single dependency.
```xml
com.github.olle
query-response-spring-amqp
${SOME-TAG}
```
_At the current time we recommend using https://jitpack.io[Jitpack] to resolve
the dependency. Query/Response will however be published to the Sonatype OSS
repository and Maven Central in the future._
=== `@EnableQueryResponse`
:QueryResponseConfiguration: link:./src/main/java/com/studiomediatech/queryresponse/QueryResponseConfiguration.java
To initialize the Query/Response library resources, and load the
{QueryResponseConfiguration}[`QueryResponseConfiguration`] class, the
`@EnableQueryResponse` annotation can simply be added to any Spring Boot
application starter.
```java
@SpringBootApplication
@EnableQueryResponse
public class App {
...
}
```
The configuration will try to connect to an AMQP message broker, using the
common configurations for Spring AMQP. The default setup will try to connect
to a local broker with the username and password `guest/guest`.
_Please see the provided `examples/` for a simple setup with
https://www.rabbitmq.com[RabbitMQ] as a docker container, to get you started._
== Queries
The fluid Query/Response API makes it easy for developers to understand and
decide on a strategy for service integration. Timeouts are _first-class
citizens_ in the API and protect against surprises.
```java
var authors = queryBuilder.queryFor("authors", String.class)
.waitingFor(800)
.orEmpty();
```
== Responses
To create responding services we provide a really effective and expressive
fluid-API. Developers benefit from the declarative style, and won't have to
write any boilerplate code. It is easy to understand, work with and explore.
Very simple scenarios can quickly be created, for tests or proof of concept
work.
```java
responseBuilder.respondTo("authors", String.class)
.withAll()
.from("William Gibson", "Isaac Asimov", "J.R.R. Tolkien");
```
== Documentation & Examples
Read more and learn how to use Query/Response, and how it works, in the
https://olle.github.io/query-response-spring-amqp/[online documentation].
Also make sure to check out the working link:./examples/[examples] to get
started quickly with Query/Response.
=== Request For Discussion (RFD) & Architectural Design Records (ADR)
Under the link:./docs[docs] folder there are link:./docs/rfd[RFD] documents,
which provide a way for anyone to introduce ideas and trigger a discussion, as
well as link:./docs/adr[ADR] documents that describe which important decisions
were made, and why. Read more in the
https://olle.github.io/query-response-spring-amqp/[online documentation].
== Versions & Spring Boot
This project is very much an extension and amalgamation of the AMQP features
provided in Spring Boot. Therefore, there needs to be a living relationship
between the generational release versions of Spring Boot and this project.
We will build and tag an initial version `0.9.x` as a _preliminary_ working
version of Query/Response. This version will only support the current and latest
version of Spring Boot, in our `main` branch.
* `main` -> Spring Boot 3.5.x
There will be no other minor version increment under the initial major version
`0.x.x`. The `0.9.x` version will be used to iron out bugs and gather feedback
for an upcoming stable `1.0.0` version.
=== No longer active
The following branches and versions are no longer actively supported or
back-ported to. The intent is to never linger behind the list of active Spring
Boot versions.
* `zzz/spring-boot-2.7.x` -> Spring Boot 2.7.x
* `zzz/spring-boot-2.6.x` -> Spring Boot 2.6.x
* `zzz/spring-boot-2.5.x` -> Spring Boot 2.5.x
* `zzz/spring-boot-2.4.x` -> Spring Boot 2.4.x
* `zzz/spring-boot-2.3.x` -> Spring Boot 2.3.x.RELEASE
* `zzz/spring-boot-2.2.x` -> Spring Boot 2.2.x.RELEASE
* `zzz/spring-boot-2.1.x` -> Spring Boot 2.1.x.RELEASE
* `zzz/spring-boot-1.5.x` -> Spring Boot 1.5.x.RELEASE
However, I'm sure that anyone who still needs to use an older version of
Spring Boot can find the code in the `zzz/` branches, and use it as a
reference for their own projects. The code in these branches will not be
actively maintained, but will remain available for reference.
== Demo Setup & Development
Prerequisites for development include a working Java 21+ environment, docker
and docker-compose as well as node and npm for building the frontend UI.
To get a local development environment up and running, you can use the provided
`docker-compose.yml` file to start a RabbitMQ container. This will allow you to
test and develop Query/Response functionality locally.
We've also prepared a quick and easy way to build, install and start a demo
setup of Query/Response locally. Just simply run:
```shell
> make demo
```
This will build the project, install the dependencies, and start a demo setup
with a querying service and a responding service. As well a the UI for
monitoring and exploring the system. The UI will be available at
http://localhost:8080.
Happy coding!
---
Spring and Spring Boot is a trademark of Broadcom Inc. and/or its subsidiaries.