(Web) Service Dependence

Say, for example, we have a SIMPLE eCommerce system with two separate systems: an inventory management system (IMS) and an order management system (OMS). Suppose that IMS provides inventory information (getItem, getItemQuantities, etc.), while OMS provides ordering services (startOrder, addItemToOrder, finalizeOrder, etc.).

The two systems are implemented as web services using different backends. In OMS, suppose a simplified model, for example:

public class Order {
    private int orderId;
    private List LineItem;
    ...
}

public class LineItem {
    private int orderId;
    private int itemId;
    private int quantity;
    private int subTotal;
    ....
}

In IMS, suppose the model is similar:

public class Category {
    private int catId;
    private List Item;
    ...
}

public class Item {
    private int itemId;
    .... (other attributes)
}

You can easily calculate the simple structure of the db table to implement the above.

As one use case, consider a customer adding an item to an order. For this request, OMS makes several service / database calls:

  • orderId (, ).
  • IMS itemId ( - diff DB)
  • IMS ( - diff DB)
  • ()

? ?


[.]:. , , OMS , orderId orderLineItems, itemId, . . / ( IMS) OMS?

+3
6

SOA .

, , , .

, , , , , .

? ( 2PC ), , , SOA , - , .

, , reuisite. , " ", . , , .

. , , . (, , ). , , , " " ", , , ".

- .

+1

, .

0

orderId.

ValidatePlaceInDetails,    itemId

.

, 2 3.

0

, , .

, , , - , . , , , , .

memcached.

0

SOA, , -.

ESB, , ESB , , .

, ESB.

ESB, , : https://open-esb.dev.java.net/

, -, , .

, .

, VIP- , , , , , .

ESB , , , , wsdl - ESB.

0

I would only make one request in IMS with a request to check if item X is really in stock. If this is not a valid element, IMS should return some result code indicating that I requested an invalid element. This way you can save yourself a trip to IMS. If the number of items I requested is out of stock, then I would expect a different result code indicating this.

0
source

Source: https://habr.com/ru/post/1717398/


All Articles