Saga Management Console will interact with the API's exposed by Alpha Server to get the list of transactions.

Currently Alpha Server only exposes 1 API '/events' for only test profile, this data is enough for displaying whole bunch of information's in the Management Console, but this will be overhead for the UI as every time lot of data might be coming to UI and UI has to do processing of this data.

As the Alpha server already has implementation to interact with the Database so it makes more sense to expose a bunch of API's for Saga UI to get the required details.

So here I propose the list of API's to expose in Alpha Server.

https://app.swaggerhub.com/apis/ServiceComb/SagaManagamentConsole/1.0.0 

Similar set of API's will also be available for TCC events with a different base path and will be extensible to anymore events in future.

Some Details of the API's exposed are : 

Base Path : 

  • /saga
  • /tcc

API's

  • /stats
    Functionality : This will return the count of total transactions, pending transactions, committed transactions, rollbancked transactions and failure rate.
    Usage : This will be used by Dashboard to display the count on the cards.
  • /recent
    Parameters : 
    • status - Status of transaction (PENDING, COMMITTED, COMPENSATING, ROLLBACKED)
    • count - Number of last transactions to be returned (max: 15)
    Functionality : This will return the list of recent transactions
    Usage : This will be used by the Dashboard to display last 5 transactions
  • /transactions
    Parameters : 
    • status - Status of transaction (ALL, PENDING, COMMITTED, COMPENSATING, ROLLBACKED)
    • pagination - is pagination enabled
    • countPerPage - List of elements per page
    • pageNumber - Current Page to be sent
    Functionality : This will return the list of transactions which pagination enabled.
    Usage : This will be used by Transaction page to display list of transactions
  • /findtransactions
    Parameter : 
    • globalID : GlobalID of the transactions
    • microserviceName : Name of the Microservice
    • duration : Json with starttime & endtime in it
    Functionality : This will display all the list of sub-transactions  for a particular Global ID or MicroService or Duration.
    Usage : This will be used by Transactions Topology  Page to display the topography of the transactions


Here is the Postman Collection for the newly developed API's SagaConsoleApi.postman_collection.json

Please review and feedback.



  • No labels

2 Comments

  1. It think it could be better if we have the start, end time parameters when looking up the transaction.

  2. willem jiang thanks for the suggestion, I will add these parameters in the findTransactions API, but 1 thing is that all these parameters will be on OR operations, means either you can find by microserviceName or globalID or time