ÎçÒ¹DJÃâ·ÑÍêÕûÊÓƵ¸ßɽÓëÔÆÎí£¬´øÀ´·áÅæµÄË®×ÊÔ´£»ÔƸǷåϵÄÔƸÇÏ¿¹È£¬ÆÙ²¼ºäÃùÉù£¬ÈÕ²ú¾«Æ·¿¨2¿¨Èý¿¨Ò»Ö±ÓÚ¶ú¡£×îÖøÃûµÄÓС°Ê®°ËÁú̶¡±£¬Ï¿¹È×ÔÉ϶øÏ£¬Ê®°Ë¿î½ûÓÃÈí¼þÏÂÔØÃâ·Ñ[ÌìÌìÃâ·Ñ¿´´óƬapp·ÖÏí]ÆÙ²¼´Ó¸ßµ½µÍ£¬ÐγÉÒ»¸ö¸öÆÙÓë̶¡£ÆÙ²¼´Ó¸ß´¦ÍùÏ£¬ÑØ×Åɽ±ßµÄÎó²î£¬¾ÓÉÊÝËÀºóÇÄÇĶøÏ£¬Ç¡ËÆÓÐÒâ±Ü¿ªÊ÷ÁÖµÄî¿°í£¬ÉñÍùÌø³öÏ¿¹È£¬ÈÎÆäÌìÂíÐпա£
Ô¤ÆÚÄÚ(n¨¨i)µÄÒì³££¬ÊÇ(sh¨¬)Ö¸³ÌÐòÌáÇ°(qi¨¢n)°ì·¨(zh¨°u) 3£º·¢ËÍ MQ ֪ͨÏÂÓÎÕËÎñϵͳÈë(r¨´)ÕË£ºÈôÊÇ(gu¨¯)ʧ°Ü(b¨¤i)µÄ»°£¬ºÍÉÏÒ»²½Àà(l¨¨i)ËÆ£¬ÐèÒª(y¨¤o)ÈÕÖ¾±í + ׼ʱʹÃüÅâ³¥¡£°ì·¨ 4/5£º¸üРDB µÄ(de)»¹¿î¼Í¼״̬(t¨¤i)Ϊ¡°¿Û¿î(ku¨£n)Àֳɡ±»ò(hu¨°)¡°¿Û¿îʧ°Ü(b¨¤i)¡±£ºÈç(r¨²)¹û¸üРDB ²Ù×÷·ºÆðÁËʧ°Ü£¬ÔòÐèÒª¶¨(d¨¬ng)ʱ(sh¨ª)ÈÎ(r¨¨n)Îñ£¬ÖØÊÔÅâ³¥£¬Õâ(zh¨¨)ÐèÒª½èÖúÈÕÖ¾±íÀ´(l¨¢i)»Ö¸´£¬ºǫ́׼ʱʹÃüȥɨ(s¨£o)Ãè¸ÃÈÕ(r¨¬)Ö¾±í£¬ÒÔ´Ó(c¨®ng)Ö®(zh¨©)ǰʧ°ÜµÄ°ì·¨£¬¼Ì(j¨¬)ÐøÖ´ÐÐÏÂÈ¥£¬Àà(l¨¨i)ËÆ(sh¨¬)ÓÚ¡°¶Ïµã(di¨£n)Ðø´«¡±£¬ÕâÀïÎÒÃÇÔݲ»ÏêÊö£» °ì·¨ 5£º·¢ËÍ MQ ֪ͨÏÂÓÎÕËÎñϵͳ(t¨¯ng)ÈëÕË£ºÈôÊÇ(gu¨¯)·¢ËÍʧ(sh¨©)°ÜµÄ»°(hu¨¤)£¬ºÍÉÏ(sh¨¤ng)Ò»²½ÀàËÆ£¬ÐèÒªÈÕ(r¨¬)Ö¾±í + ׼ʱÈÎ(r¨¨n)Îñ²¹(b¨³)³¥£»°ì·¨ 6£ºÕË(zh¨¤ng)ÎñϵͳÈëÕË£ºÓÉÓÚͨ³£µÄ MQ£¨ÎÒÃÇÓõÄÊÇ RocketMQ£©×Ô¼ºÓÐ at-least-once µÄÖØÊÔ»úÖÆ£¬Õâ¾Í°ü¹ÜÁËÐÂÎűØÐ豻׼ȷÏûºÄ£¨Ö»ÒªÕËÎñϵ(x¨¬)ͳ³Ì(ch¨¦ng)Ðò²»»á×Ô¶¯ ignore µô£©²Å»á±» ack£¬ÒÔÊÇ(y¨«)Õâ¸öµØ·½µÄ×îÖÕÀֳɣ¬¾ÍÓÉÐÂÎÅÖÐÐÄ(ji¨¡n)¼þÀ´°ü¹ÜÁË£»Èç(r¨²)¹ûʹÓÃµÄ MQ ×é(z¨³)¼þû(m¨¦i)ÓÐÕâÖÖÖØ(zh¨°ng)ÊÔ»úÖÆ£¬ÔòÐèÒªÔÚÕËÎñϵͳ¶Ë½¨(ji¨¤n)Á¢ÈÕÖ¾(zh¨¬)±í£¬À´Åâ³¥£¨ÈôÊÇ MQ ÓÐ(y¨¯u)¶ª(di¨±)ʧ(sh¨©)Ïû(xi¨¡o)Ï¢(x¨©)µÄΣº¦£¬ÄÇ(n¨¤)ÈÔÈ»¿ÉÄÜ·×Æç(y¨©)ÖÂ(zh¨¬)£©¡£Ë¼Á¿µ½µÄ¡ª¡ªÖ÷ÒªÊÇ try/catch ÖÐ catch µ½ Exception ²¿·ÖµÄÂß¼Îç(w¨³)Ò¹DJÃâ(mi¨£n)·ÑÍêÕûÊÓ(sh¨¬)Ƶ¡£²½(b¨´)Öè 1£ºÈÕ²ú¾«Æ·¿¨2¿¨(k¨£)Èý¿¨¸üÐÂ(x¨©n) DB µÄ(de)»¹(h¨¢i)¿î(ku¨£n)¼Ç(j¨¬)¼״(zhu¨¤ng)̬Ϊ¡°¿Û(k¨°u)¿îÖС±£ºÆäÊÇÁ÷³Ì(ch¨¦ng)µÚ(d¨¬)Ò»²½£¬Èç(r¨²)¹ûËü(t¨¡)ʧ°Ü£¬Á÷³Ì(ch¨¦ng)½á(ji¨¦)Êø£¬²»(b¨´)Ðè(x¨±)²¹(b¨³)³¥£»°ì·¨(zh¨°u) 2£ºÍ¬²½(b¨´)µ÷(di¨¤o)ÓõÚÈý·½Ö§(zh¨©)¸¶(f¨´)ÇþµÀÀ´¿Û¿î£ºÀý×ÓÖеÄ(de)Õâ¼Ò·þ(f¨²)ÎñÉÌ(sh¨¡ng)µÄ¿Û¿î½Ó¿Ú£¬Ìá(t¨ª)¹©µÄÊÇÖ»ÓÐ(y¨¯u)Á½(li¨£ng)ÖÖЧ¹û״̬µÄ×óȯ(yu¨¥)£º¡°¿Û(k¨°u)¿î(ku¨£n)Àֳɡ±»ò¡°¿Û¿îʧ°Ü(b¨¤i)¡±¡£