The Two Generals ParadoxIllustrating the Two Generals ParadoxSolution ApproachesMicroservices as GeneralsTCP/IP: The Valley Between the GeneralsTransactionsHardware Instruction Sets at the Core of TransactionsThe ACID in the TransactionTransaction ModelsTransaction Attributes in Jakarta EE vs. SpringTransaction Isolation MechanismsTransaction Isolation LevelsTransaction ConcurrencyTransaction Isolation Control MethodsEnterprise Transaction CategoriesACID TransactionsBASE = ACID in SlicesBASE TransactionsRelaxed BASE TransactionsACID vs. BASEDistributed Transactions RevisitedLocal TransactionsDistributed TransactionsDistributed Transactions in JavaDistributed Transaction Example Using MySQL, ActiveMQ, Derby, and AtomikosThe Example ScenarioCode the Example ScenarioMicroservice 1: Quote Processing (Broker-MySQL-ActiveMQ)Microservice 2: Broker-WebMicroservice 3: Quote Settlement (Settlement-ActiveMQ-Derby)Microservice 4: Settlement-WebBuild and Test the Example’s Happy FlowMicroservice 1: Quote Processing MicroserviceMicroservice 2: Broker Web MicroserviceMicroservice 3: Quote Settlement MicroserviceMicroservice 4: Settlement Web MicroserviceTest the Transaction Rollback ScenarioSimulating Relaxed BASE AnomaliesTest the Lost Message ScenarioTest the Duplicate Message Sent ScenarioTest the Duplicate Message Consumption ScenarioTest the Message Consumed, Processing Failure ScenarioTest the Message Redelivery ScenarioCommon Messaging PitfallsTest the Message Received Out of Order ScenarioSummary