SlideShare uma empresa Scribd logo
1 de 61
www.dotnetconf.net
•
•
•
•
•
•
https://twitter.com/hughcards/status/423952995240648704
Message Queue Basic
https://tw.saowen.com/a/63c04f9638e1f962669b04d6acc6b6eae697b42978b338384
c0a8626bf3de617
http://www.rabbitmq.com/getstarted.html
Design (Architecture)
如果我需要等待 queue 處理結果,
才能進行下一步?
RPC (over queue) & Async Call?
http://www.rabbitmq.com/tutorials/tutorial-six-dotnet.html
Queue RPC 基本運作原理:
送出的 Message 標註 Correlation ID 與 Reply Queue 告知
回傳的管道。實作上的挑戰在於非同步的處理,以及 C / S
都要扮演 Consumer 的角色 (對不同的 Queue)。
Implementation & Demo
( .NET Standard 2.0 )
Main 呼叫 Client.CallAsync( ) 要執行完成這段 code 才會
回傳 async Task.
CallAsync( ) Task 回傳後, await 必須等到這段結束才會
拿到 Result
https://columns.chicken-house.net/2007/12/17/threadpool-
%E5%AF%A6%E4%BD%9C-3-autoresetevent-manualresetevent/
https://columns.chicken-house.net/2018/05/10/tips-handle-shutdown
References
https://www.cloudamqp.com/blog/2018-01-19-part4-rabbitmq-13-common-errors.html
3. Don’t share channels between threads
6. Don't have an unlimited prefetch value
http://www.rabbitmq.com/tutorials/tutorial-six-
dotnet.html
https://dzone.com/articles/rabbitmq-request-
response
https://www.rabbitmq.com/direct-reply-to.html
https://www.rabbitmq.com/releases/rabbitmq-dotnet-client/v3.4.2/rabbitmq-dotnet-client-3.4.2-client-htmldoc/html/nam
https://github.com/rabbitmq/rabbitmq-dotnet-client/tree/master/projects/client/RabbitMQ.Client/src/client/messagepat
【我們正在招募】
● 架構師
● C# Asp.Net MVC開發工程師
https://www.91app.com/careers/
fb.com/Study4.twfb.com/groups/216312591822635 Study4.TW
.NET Conf 2018 - Message Queue Based RPC

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

DevOps勉強会
DevOps勉強会DevOps勉強会
DevOps勉強会
 
Weaveを試してみた
Weaveを試してみたWeaveを試してみた
Weaveを試してみた
 
Dapr on Kubernetes
Dapr on KubernetesDapr on Kubernetes
Dapr on Kubernetes
 
CI/CD、自動化,你還沒準備好(GCPUG.TW Meetup #34)
CI/CD、自動化,你還沒準備好(GCPUG.TW Meetup #34)CI/CD、自動化,你還沒準備好(GCPUG.TW Meetup #34)
CI/CD、自動化,你還沒準備好(GCPUG.TW Meetup #34)
 
オンプレML基盤on Kubernetes 〜Yahoo! JAPAN AIPF〜
オンプレML基盤on Kubernetes 〜Yahoo! JAPAN AIPF〜オンプレML基盤on Kubernetes 〜Yahoo! JAPAN AIPF〜
オンプレML基盤on Kubernetes 〜Yahoo! JAPAN AIPF〜
 
[2020 .NET Conf] 企業Azure DevOps Service 實際應用架構與秘辛
[2020 .NET Conf] 企業Azure DevOps Service 實際應用架構與秘辛[2020 .NET Conf] 企業Azure DevOps Service 實際應用架構與秘辛
[2020 .NET Conf] 企業Azure DevOps Service 實際應用架構與秘辛
 
網站自動化測試
網站自動化測試網站自動化測試
網站自動化測試
 
GitOps is IaC done right
GitOps is IaC done rightGitOps is IaC done right
GitOps is IaC done right
 
Docker Swarm入門
Docker Swarm入門Docker Swarm入門
Docker Swarm入門
 
大規模サービスを支えるネットワークインフラの全貌
大規模サービスを支えるネットワークインフラの全貌大規模サービスを支えるネットワークインフラの全貌
大規模サービスを支えるネットワークインフラの全貌
 
大規模微服務導入 - #1, 從零開始的系統架構設計概觀
大規模微服務導入 - #1, 從零開始的系統架構設計概觀大規模微服務導入 - #1, 從零開始的系統架構設計概觀
大規模微服務導入 - #1, 從零開始的系統架構設計概觀
 
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps OnlineGKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
 
Nginxを使ったオレオレCDNの構築
Nginxを使ったオレオレCDNの構築Nginxを使ったオレオレCDNの構築
Nginxを使ったオレオレCDNの構築
 
JCBの Payment as a Service 実現にむけたゼロベースの組織変革とテクニカル・イネーブラー(NTTデータ テクノロジーカンファレンス ...
JCBの Payment as a Service 実現にむけたゼロベースの組織変革とテクニカル・イネーブラー(NTTデータ テクノロジーカンファレンス ...JCBの Payment as a Service 実現にむけたゼロベースの組織変革とテクニカル・イネーブラー(NTTデータ テクノロジーカンファレンス ...
JCBの Payment as a Service 実現にむけたゼロベースの組織変革とテクニカル・イネーブラー(NTTデータ テクノロジーカンファレンス ...
 
実運用して分かったRabbit MQの良いところ・気をつけること #jjug
実運用して分かったRabbit MQの良いところ・気をつけること #jjug実運用して分かったRabbit MQの良いところ・気をつけること #jjug
実運用して分かったRabbit MQの良いところ・気をつけること #jjug
 
Ethernetの受信処理
Ethernetの受信処理Ethernetの受信処理
Ethernetの受信処理
 
大型製造業實踐DevOps 團隊之路
大型製造業實踐DevOps 團隊之路大型製造業實踐DevOps 團隊之路
大型製造業實踐DevOps 團隊之路
 
大型 Web Application 轉移到 微服務的經驗分享
大型 Web Application 轉移到微服務的經驗分享大型 Web Application 轉移到微服務的經驗分享
大型 Web Application 轉移到 微服務的經驗分享
 
20230105_TITECH_lecture_ishizaki_public.pdf
20230105_TITECH_lecture_ishizaki_public.pdf20230105_TITECH_lecture_ishizaki_public.pdf
20230105_TITECH_lecture_ishizaki_public.pdf
 
運用中の大規模オンラインゲームで 8年ぶりにPHPバージョンアップをした話
 運用中の大規模オンラインゲームで 8年ぶりにPHPバージョンアップをした話 運用中の大規模オンラインゲームで 8年ぶりにPHPバージョンアップをした話
運用中の大規模オンラインゲームで 8年ぶりにPHPバージョンアップをした話
 

Semelhante a .NET Conf 2018 - Message Queue Based RPC

Jvm operation casual talks
Jvm operation casual talksJvm operation casual talks
Jvm operation casual talks
Yusaku Watanabe
 
Varnish @ Velocity Ignite
Varnish @ Velocity IgniteVarnish @ Velocity Ignite
Varnish @ Velocity Ignite
Artur Bergman
 

Semelhante a .NET Conf 2018 - Message Queue Based RPC (20)

[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래[1C2]webrtc 개발, 현재와 미래
[1C2]webrtc 개발, 현재와 미래
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
So You Want To Write Your Own Benchmark
So You Want To Write Your Own BenchmarkSo You Want To Write Your Own Benchmark
So You Want To Write Your Own Benchmark
 
Service Virtualization - Next Gen Testing Conference Singapore 2013
Service Virtualization - Next Gen Testing Conference Singapore 2013Service Virtualization - Next Gen Testing Conference Singapore 2013
Service Virtualization - Next Gen Testing Conference Singapore 2013
 
Performance Oriented Design
Performance Oriented DesignPerformance Oriented Design
Performance Oriented Design
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
 
Sprint 127
Sprint 127Sprint 127
Sprint 127
 
PVS-Studio. Static code analyzer. Windows/Linux, C/C++/C#. 2017
PVS-Studio. Static code analyzer. Windows/Linux, C/C++/C#. 2017PVS-Studio. Static code analyzer. Windows/Linux, C/C++/C#. 2017
PVS-Studio. Static code analyzer. Windows/Linux, C/C++/C#. 2017
 
NodeJs
NodeJsNodeJs
NodeJs
 
Jvm operation casual talks
Jvm operation casual talksJvm operation casual talks
Jvm operation casual talks
 
2020 icldla-updated
2020 icldla-updated2020 icldla-updated
2020 icldla-updated
 
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantImplementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 
Static analysis and writing C/C++ of high quality code for embedded systems
Static analysis and writing C/C++ of high quality code for embedded systemsStatic analysis and writing C/C++ of high quality code for embedded systems
Static analysis and writing C/C++ of high quality code for embedded systems
 
Varnish @ Velocity Ignite
Varnish @ Velocity IgniteVarnish @ Velocity Ignite
Varnish @ Velocity Ignite
 
Top Performance Problems in Distributed Architectures
Top Performance Problems in Distributed ArchitecturesTop Performance Problems in Distributed Architectures
Top Performance Problems in Distributed Architectures
 
Tuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on MobicentsTuning and development with SIP Servlets on Mobicents
Tuning and development with SIP Servlets on Mobicents
 
Service mesh from linkerd to conduit (cloud native taiwan meetup)
Service mesh from linkerd to conduit (cloud native taiwan meetup)Service mesh from linkerd to conduit (cloud native taiwan meetup)
Service mesh from linkerd to conduit (cloud native taiwan meetup)
 
ASP.NET Core dospělo už i v Linuxu
ASP.NET Core dospělo už i v LinuxuASP.NET Core dospělo už i v Linuxu
ASP.NET Core dospělo už i v Linuxu
 
Practical Operation Automation with StackStorm
Practical Operation Automation with StackStormPractical Operation Automation with StackStorm
Practical Operation Automation with StackStorm
 

Mais de Andrew Wu

Mais de Andrew Wu (8)

微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
微服務資料管理的天堂路 - CQRS / Event Sourcing 的應用與實踐
 
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
 
微服務基礎建設 - Message Queue
微服務基礎建設 - Message Queue微服務基礎建設 - Message Queue
微服務基礎建設 - Message Queue
 
微服務的基礎建設 - Service Discovery, Andrew Wu
微服務的基礎建設 - Service Discovery, Andrew Wu微服務的基礎建設 - Service Discovery, Andrew Wu
微服務的基礎建設 - Service Discovery, Andrew Wu
 
Monitoring Tools 大亂鬥 - Consul
Monitoring Tools 大亂鬥 - ConsulMonitoring Tools 大亂鬥 - Consul
Monitoring Tools 大亂鬥 - Consul
 
與大師對談: 轉移到微服務架構必經之路 ~ 系統與資料庫重構
與大師對談: 轉移到微服務架構必經之路~ 系統與資料庫重構與大師對談: 轉移到微服務架構必經之路~ 系統與資料庫重構
與大師對談: 轉移到微服務架構必經之路 ~ 系統與資料庫重構
 
容器驅動開發 - .NET Conf 2017 @ 台中
容器驅動開發 - .NET Conf 2017 @ 台中容器驅動開發 - .NET Conf 2017 @ 台中
容器驅動開發 - .NET Conf 2017 @ 台中
 
API Token 入門
API Token 入門API Token 入門
API Token 入門
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 

.NET Conf 2018 - Message Queue Based RPC

Notas do Editor

  1. 把資訊點連起來,能靈活運用才是知識
  2. Basic: store and forward, queue 可以當作 buffer, 不論是 client or server 短暫離線都不會有影響 Like email, 使用信件溝通,叫可靠也較不會影響到他人目前的工作。如果你不需要及時的對談,用 email 是叫好的選擇。 可靠 寄後不理 留紀錄 有空再處理,對方不會瞬間被忙翻
  3. 號碼機 就是典型的 QUEUE 受理櫃檯就是 WORKER (CONSUMER) 顧客就是 CLIENT (PRODUCER) 決定乘載能力的幾個關鍵: 號碼機能否在有限期間內 (EX: 5 sec) 印出號碼單給 USER? 場地有沒有足夠空間給客人等待? 服務櫃台是否夠多,足以消化 QUEUE 內的 JOB ? 處理速度 = 服務櫃台數量 x 單一櫃檯的服務速度 等候人數 = QUEUE LENGTH = WAITING TIME 等候人數 = QUEUE STORAGE 客人可以先離開辦事情 櫃台若需要離開 (吃飯、上廁所),只要處理完已受理的客人 (叫號),別在叫下一號,就可以安全的暫離 擴充櫃檯數就能提升服務量 (SCALE OUT)
  4. Orchestration: 編配 (指: 交響樂, 有總指揮) Choregraphy: 編排 (編舞、指: 芭雷舞)
  5. Var a = await demo.SendAsync(“Hello!”); Console.WriteLine(….. {a} … );
  6. PublishMessage()
  7. MSMQ 也有類似機制,可以指定 correlaction id 取得 reply message, 而不用按照順序 FIFO 找 MSMQ 的 ack 狀態有專屬管道可以通知 client, 讓 client 能做到 whatsapp 類似功能: 已送達 V, 已讀 VV