Git Product home page Git Product logo

query-response-spring-amqp's Introduction

Query/Response for Spring® AMQP

badge community

WIP: Driving the initial version from this README, please feel free to provide feedback through issues.

Coming in 2024: support only for the latest Spring Boot CURRENT version.

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 ui for more information.

ui

Quickstart

The Query/Response library can easily be added to any Spring Boot® project, as a single dependency.

  <dependency>
    <!-- From Jitpack-repo -->
    <groupId>com.github.olle</groupId>
    <artifactId>query-response-spring-amqp</artifactId>
    <version>${SOME-TAG}</version>
  </dependency>

At the current time we recommend using Jitpack to resolve the dependency. Query/Response will however be published to the Sonatype OSS repository and Maven Central in the future.

@EnableQueryResponse

To initialize the Query/Response library resources, and load the QueryResponseConfiguration class, the @EnableQueryResponse annotation can simply be added to any Spring Boot application starter.

@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 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.

  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.

  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 online documentation.

Also make sure to check out the working examples to get started quickly with Query/Response.

Request For Comments (RFC) & Architectural Design Records (ADR)

Under the docs folder there are RFC documents, which provide a way for anyone to introduce ideas and trigger a discussion, as well as ADR documents that describe which important decisions were made, and why.

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 is tracked in branches supporting the active Spring Boot versions, as well as the main branch.

  • main → Spring Boot 3.0.x

  • spring-boot-2.7.x → Spring Boot 2.7.x

  • spring-boot-2.6.x → Spring Boot 2.6.x

  • spring-boot-2.5.x → Spring Boot 2.5.x

From each branch there will be tagged releases, denoting the version of Spring Boot that it is built against. For example 0.9.0-SB2_3_6 means it was built with the Spring Boot 2.3.6.RELEASE dependency.

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 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.

  • spring-boot-2.4.x → Spring Boot 2.4.x

  • spring-boot-2.3.x → Spring Boot 2.3.x.RELEASE

  • spring-boot-2.2.x → Spring Boot 2.2.x.RELEASE

  • spring-boot-2.1.x → Spring Boot 2.1.x.RELEASE

  • spring-boot-1.5.x → Spring Boot 1.5.x.RELEASE

Happy coding!


Spring and Spring Boot are trademarks of Pivotal Software, Inc. in the U.S. and other countries.

query-response-spring-amqp's People

Contributors

dependabot[bot] avatar fheft avatar gitter-badger avatar maxdobler avatar olle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

query-response-spring-amqp's Issues

Min latency should be lowest measured non 0

The latency metrics should either be fixed, in case there is a bug, or tuned. Actually a min and max latency is really only interesting as a moving, or windowed, measurement.

First step would at least be to check why it tends towards 0, and synthetically disallow it.

Initial, proper API documentation for all builder types

For the Query/Response library to be usefull, to actual real world developers, there have to be supreme API documentation support, distributed with the production dependency.

How do we define supreme?

  • Conventional and idiomatic language use (it looks the same)
  • Human readable sentences.
  • Code-examples directly in the API docs.

Responses resilience on broker disconnect

REPRODUCE: Use the https://github.com/olle/query-response-spring-amqp/tree/master/examples/singleresponse example, which provides the very minimal use of the Query/Response library, and only registers the implicit statistics response.

This basically creates a client with a listener for messages on the query-response topic exchange, routed to an anonymous queue.

BUG: The connection to the response queue (anonymous) never recovers, the listener container and the broker both end up in an endless dance, where the queue can't be re-declared, nor found (404).

EXPECTED: Response listeners, should recover as defined by the Spring AMQP channling handling and listener container configuration (capabilities).

Ensure control over AMQP connection and template

For proper production readiness, it is required that this library does not act upon shared resources for an application context. The opposite is also important, there should be very little coupling between configurations of the AMQP resources for the application and the Query/Response library.

This means control over the AMQP connection, it's properties and the AMQP Template, through a factory, is probably required in order to introduce the Query/Response library as a well behaved component, into a production application.

Baby needs a logo!

Query/Response is a movement! It deserves a logo or brand, there's already some direction towards colors in the UI and it would of course be sweet to pimp this baby another notch, by adding a juicy logo.

Downgrade to JDK 8 for better enterprise coverage

So, I'm thinking it's probably more or less required to support JDK 8 in order to be considered an option to a majority of enterprise projects.

I personally don't have a problem with that.

What do you think?

Metrics in the UI, visualized with graphs

This would be the bow on the ribbon, tying the v0.9 release together. Adding graphs to the UI visualization - nailing down the provided extra value and observability that is provided out of the box.

Who's with me?

Determine if a live-node is: publishing only

In order to make the metrics, in the list of live-nodes, valuable. It should be distinctly visible if a node is only publishing (responses), and such does not suffer from a low success rate.

Alternatively, calculate success rate with regards to published responses too, which at the moment is not really an issue (fire-and-forget) and would retain a very high success rate on average.

The goal is to avoid false negative feedback (red numbers) for nodes that are not performing badly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.