1.HTTP/2åè®®ä¹Streamãåçç¬è®°ã
HTTP/2åè®®ä¹Streamãåçç¬è®°ã
åé¢ä¸ç¯ä»ç»äºHPPT/2çâè¿æ¥åè¨âãâäºè¿å¶æ¡¢âãâ头é¨å缩âãæ¬æä»âæµåå¤è·¯å¤ç¨âãâæµç¶æâãâæµéæ§å¶âãâæµä¼å 级âãâHTTP/2æ©å±âä»ç»HTTP/2åè®®æµç¸å ³ç¥è¯ãæµ
åé¢ä»ç»æ¡¢æ ¼å¼æ¶ï¼æ¯ä¸ªæ¡¢é½æä¸ä¸ªæµæ 示ï¼æ è®°èªå·±å±äºåªä¸ªæµãéè¿å°ç¸åæµæ è¯çæ¡¢ç»è£ ï¼æ¡¢ä¹é´æ¶æä¸¥æ ¼é¡ºåºçï¼å³å½¢æäºâæµâã
å¤è·¯å¤ç¨
ä¸ä¸ªHTTP/2è¿æ¥å¯ä»¥å¹¶éå¾å¤ä¸ªæµï¼æµID顺åºéå¢ä¸äºç¸ç¬ç«ï¼å½¢æå¤è·¯å¤ç¨ãç±å®¢æ·ç«¯åèµ·çæµID为å¥æ°ï¼æå¡ç«¯åèµ·ç为å¶æ°ã
idle
æµç©ºé²ç¶æï¼å¯ä»¥åéæ¥æ¶HEADERS帧
open
æµå¼å¯ç¶æï¼idleåéæè æ¥åHEADERS帧åï¼ç¶æåæ´ä¸ºå¼å¯
half closed
åéå å«END_STREAMæ¡¢çä¸ç«¯æµè½¬ä¸ºæ¬å°åå ³éhalf closed(local)ï¼è¡¨ç¤ºå®¢æ·ç«¯åé请æ±æ°æ®å®æ¯ï¼çå¾ æå¡ç«¯ååºæ°æ®ï¼æ¥åå°æå¡ç«¯åéçEND_STREAMè¿å ¥closeå ³éç¶æãæ¥åEND_STREAMæ¡¢çå¦ä¸ç«¯ç§°ä¸ºè¿ç¨åå ³éç¶æhalf closed(remote)ï¼è¡¨ç¤ºæå¡ç«¯ç¥é客æ·ç«¯è¯·æ±å·²ç»åéå®æ¯ï¼å¤çç»æåå¯ä»¥åéååºæ°æ®ï¼å¹¶åéEND_STREAMå°å®¢æ·ç«¯ï¼è¿å ¥closeå ³éç¶æã
close
æµçå ³éç¶æãé¤äºhalf closedæ°æ®åéç»æå ³éå¤ï¼åéRST_STREAM(åçé误æåæ¶)ä¹å¯å ³éæµã
æµç¶æ交äºç¤ºæå¾
æµéæ§å¶æ¯ä¿æ¤æ¥æ¶æ¹çæºå¶ï¼éè¿é é¢æºå¶å®ç°ãåé端æ¯åéæ°æ®åwindowçªå£å¤§å°ç¸åºçåå°ãå½åé端æ¶å°æ¥æ¶ç«¯WINDOW_UPDATEæ¡¢åwindowçªå£å¢å ãwindowçäº0åä¸å¯ä»¥è¿è¡åéï¼çªå£åå§å¼ä¸ºåèã
éè¿åé端åæ¥æ¶ç«¯åéä¼å 级æéæå¾ æ¥æ¶ç«¯ç»äºèµæºåé æ¯æï¼æ¥å端ä¸ä¿è¯ä¸å®éµå®ï¼é»è®¤æé为ãä¼å 级表达å¯ä»¥éè¿HEADERSæè åç¬åéPRIORITY帧å®ç°ã
æµä¼å 级示å¾
客æ·ç«¯éè¿PRIORITY帧å¯ä»¥åè¯æå¡ç«¯å½åæµæä¾èµçæµï¼å½¢ææµä¾èµæ ãåä¸ç¶çº§çå个åèç¹éè¿æéåé èµæºï¼ç¶çº§å åé èµæºä¼ è¾ç»æåï¼ååé å级èµæºã
éHTTP/2çåç¯æç« ï¼å¯¹HTTP2å·¥ä½åçæäºå ¨å±ç认è¯ï¼ç¸ä¿¡åé 读HTTP/2ç¸å ³æç®ä¸åå°é¾ã
ä½è èæ¢ï¼åå°åºè¡é«çº§ææ¯ä¸å®¶ï¼åä¸äºãRocketMQææ¯å å¹ã审稿工ä½ãä¸æ³¨å端ä¸é´ä»¶æ¹åï¼å·²éç»å表RocketMQç³»åãKafkaç³»åãgRPCç³»åãSentinelç³»åãJava NIOç³»åãå ¶ä¸RocketMQç³»åå·²å表ä½ç¯ãæºç ãå®æãåçãè°ä¼æå¾ ä¸ä½ ä¸èµ·å¦ä¹ ã