This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

In distributed environment, flexible transaction solutions across network and service are commonly used in recharge and other scenarios.

The maximum effort notification program requirements mainly include the following two aspects:

1) There is a certain message repeat notification mechanism: the recipient may not receive the notification, so it must have a repeat notification mechanism. 2) Message proofreading mechanism: if the other party is still not notified after repeated notification, the receiving party can take the initiative to inquire information.

The difference from the ultimate consistency of reliable messages

1) Different ideas of solutions: the final consistency of reliable messages: the notifier needs to ensure that the message is sent and sent to the notifier, and the reliability of the message is guaranteed by the notifier. Maximum effort notification: The sender tries its best to notify the recipient of the service processing result. However, the recipient may fail to receive the message. In this case, the receiver needs to invoke the interface of the sender to query the service processing result.

2) Consistency of reliable messages in different business scenarios: it focuses on transaction consistency in the transaction process and completes the transaction in an asynchronous manner. Best effort notification: the focus is on post-trade notification transactions, that is, the result of the transaction is reliable notification.

3) The technical solution direction is different reliable message consistency: to solve the message from sending to receiving consistency, that is, the message is sent and received. Maximum effort notification: The consistency of messages from sending to receiving is not guaranteed, only the reliability mechanism for message receiving is provided. The reliable mechanism is that the message is notified to the receiver as best as possible, and when the message cannot be received by the receiver, the receiver takes the initiative to query the message (service processing result).

The solution

1. Internal system solutions

2. The external system solution uses network request to notify the receiving party by adding notification program, which can be a separate service or a service with the notifying party.

The differences between the two schemes

Internal system solution: The receiving notifier and MQ interface, that is, the receiving notification scheme listens to MQ, which mainly applies notifications between internal applications. External system solution: by the notifier and MQ interface, notifier monitor MQ, after receiving the MESSAGE MQ by the notifier through the Internet interface protocol to call the receiver. This scheme is mainly applied to the notification between external applications, such as alipay and wechat payment results notification.


“Welcome to the discussion in the comments section. The excavation authorities will draw 100 nuggets in the comments section after project Diggnation. See the event article for details.”