Git Product home page Git Product logo

distributed-transaction's Introduction

JTA Example

To run the example, simply type docker compose up to start Artemis broker, the broker directory is mounted under broker folder under the project, so you can change the settings on the fly.

This example shows how JTA transaction is working, you can see different behaviours by calling POST APIs.

This API shows basic setup for JTA transaction

$ curl -d '{"item":"apple", "quantity": 100}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/order/transactions

To rollback the transaction, the database transction is rolled back also JMS message won't deliver to the listener

$ curl -d '{"item":"apple", "quantity": 100}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/order/transactions/rollback

JTA will commit transaction even though listener throws an exception but it will resend failed message based on broker settings.

$ curl -d '{"item":"apple", "quantity": 100}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/order/transactions/consumer/exception
<max-delivery-attempts>2</max-delivery-attempts>

distributed-transaction's People

Contributors

sungung avatar

Watchers

 avatar

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.