Code Monkey home page Code Monkey logo

micronaut-jms-application-example's Introduction

Micronaut JMS Example Application

This app is a toy example for implementing Micronaut JMS. It also serves as the primary integration test platform for changes made to the Micronaut JMS project

How to use

Prerequisites

  1. A copy of the source code (via git clone)
  2. Docker and docker-compose

Then run

./gradlew build && docker-compose up

(this command will build the JAR and start the PostgreSQL database and ActiveMQ broker with the required configuration)

then

curl -X POST "http://localhost:8080/messages/string" -H  "accept: text/plain" -H  "Content-Type: application/json" -d "{\"message\":\"test\"}"

or navigate to the Swagger UI at http://localhost:8080/swagger-ui

This endpoint will return a UUID which you can use to track the message's progress through the message broker.

Architecture

Producing A Message

The POST endpoints at /messages/* allow you to send a message to a message queue with a variety of inputs - currently as a Map, as a String, as an Object, or as a byte[]

The destination of this message is configurable in the application.yml under the property example.jms.destination

Receiving messages

The MessageListener is defined to listen to the example.jms.destination and persist the receipt of this message to a PostgreSQL database. If the X-Max-Depth and X-Current-Depth headers are set on the message then message receipt will also trigger further messages to the queue. The number of messages produced at each level of recursion is defined by the example.jms.batch-size property in the application.yml.

Retrieving a Specific Message

If you have the UUID for a particular message then you can retrieve it from the GET /messages/{id} endpoint.

Retrieving Details of a Full Recursion

When you initiate a recursive message test then you can retrieve the results in a JSON blob using the GET /test/{id} where the id corresponds to the first message ID found in the response.

micronaut-jms-application-example's People

Contributors

elliottpope avatar

Watchers

 avatar  avatar

micronaut-jms-application-example's Issues

Add support for SQS

Support SQS in place of ActiveMQ and update Testcontainers and embedded tests

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.