troubleshooting rabbitmq and microservices that use it
TRANSCRIPT
![Page 1: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/1.jpg)
Troubleshooting RabbitMQand services that use it
![Page 2: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/2.jpg)
Who am I?• Staff Engineer, RabbitMQ @ Pivotal
![Page 3: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/3.jpg)
Who am I?• Staff Engineer, RabbitMQ @ Pivotal
• @michaelklishin, github.com/michaelklishin
![Page 4: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/4.jpg)
![Page 5: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/5.jpg)
The monolith problem
![Page 6: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/6.jpg)
![Page 7: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/7.jpg)
![Page 8: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/8.jpg)
![Page 9: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/9.jpg)
![Page 10: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/10.jpg)
![Page 11: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/11.jpg)
![Page 12: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/12.jpg)
![Page 13: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/13.jpg)
![Page 14: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/14.jpg)
![Page 15: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/15.jpg)
![Page 16: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/16.jpg)
![Page 17: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/17.jpg)
![Page 18: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/18.jpg)
![Page 19: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/19.jpg)
![Page 20: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/20.jpg)
![Page 21: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/21.jpg)
Troubleshooting publishers
![Page 22: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/22.jpg)
Troubleshooting publishers• I/O exceptions (shutdown handlers)
![Page 23: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/23.jpg)
Troubleshooting publishers• I/O exceptions (shutdown handlers)
• Publisher confirms
![Page 24: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/24.jpg)
![Page 25: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/25.jpg)
When in doubt, borrow ideas from TCP
![Page 26: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/26.jpg)
Troubleshooting publishers• I/O exceptions (shutdown handlers)
• Publisher confirms
• Returned message handlers
![Page 27: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/27.jpg)
Troubleshooting publishers• I/O exceptions (shutdown handlers)
• Publisher confirms
• Returned message handlers
• Invalid payload (e.g. fails to deserialize or decrypt)
![Page 28: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/28.jpg)
Troubleshooting publishers• I/O exceptions (shutdown handlers)
• Publisher confirms
• Returned message handlers
• Invalid payload (e.g. fails to deserialize or decrypt)
• Identifying publisher instances
![Page 29: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/29.jpg)
Troubleshooting publishers• identifying blocked (throttled) publishers
![Page 30: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/30.jpg)
Client-provided connection names in
RabbitMQ 3.6.3+
![Page 31: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/31.jpg)
Troubleshooting publishers• identifying blocked (throttled) publishers
• retries
![Page 32: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/32.jpg)
Troubleshooting publishers• spring-amqp can cover all of the above
![Page 33: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/33.jpg)
![Page 34: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/34.jpg)
![Page 35: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/35.jpg)
Troubleshooting consumers
![Page 36: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/36.jpg)
Troubleshooting consumers• I/O exceptions
![Page 37: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/37.jpg)
Troubleshooting consumers• I/O exceptions
• Inadequate delivery QoS
![Page 38: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/38.jpg)
Troubleshooting consumers• I/O exceptions
• Inadequate delivery QoS
• Lack of confirmations; double-confirming
![Page 39: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/39.jpg)
![Page 40: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/40.jpg)
Troubleshooting consumers• I/O exceptions
• Inadequate delivery QoS
• Lack of confirmations; double-confirming
![Page 41: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/41.jpg)
Troubleshooting consumers• I/O exceptions
• Inadequate delivery QoS
• Lack of confirmations; double-confirming
• Redelivery metrics
![Page 42: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/42.jpg)
Troubleshooting consumers• I/O exceptions
• Inadequate delivery QoS
• Lack of confirmations; double-confirming
• Redelivery metrics
• Identifying consumer instances
![Page 43: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/43.jpg)
Troubleshooting consumers• Consumer utilization (reported by HTTP API)
![Page 44: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/44.jpg)
Troubleshooting consumers• spring-amqp can help with some of the above
![Page 45: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/45.jpg)
![Page 46: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/46.jpg)
— W. Edwards Deming
“In God we trust, all others must bring data…”
![Page 47: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/47.jpg)
— W. Edwards Deming
“In God we trust, all others must bring data…”
![Page 48: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/48.jpg)
— What do you do for a living?
![Page 49: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/49.jpg)
— What do you do for a living? — Tell people to read the logs.
![Page 50: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/50.jpg)
Sources of data useful for debugging
![Page 51: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/51.jpg)
Sources of data useful for debugging
• Metrics
![Page 52: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/52.jpg)
Sources of data useful for debugging
• Metrics
• Your logs
![Page 53: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/53.jpg)
Sources of data useful for debugging
• Metrics
• Your logs
• Someone else's logs
![Page 54: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/54.jpg)
Sources of data useful for debugging
• Metrics
• Your logs
• Someone else's logs
• Tracing data
![Page 55: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/55.jpg)
Sources of data useful for debugging
• Metrics
• Your logs
• Someone else's logs
• Tracing data
• Wireshark (tcpdump, libpcap)
![Page 56: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/56.jpg)
![Page 57: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/57.jpg)
![Page 58: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/58.jpg)
Collecting data from RabbitMQ
![Page 59: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/59.jpg)
Collecting data from RabbitMQ
• Logs
![Page 60: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/60.jpg)
Collecting data from RabbitMQ
• Logs
• rabbitmqctl status
![Page 61: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/61.jpg)
Collecting data from RabbitMQ
• Logs
• rabbitmqctl status
• rabbitmqctl environment
![Page 62: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/62.jpg)
Collecting data from RabbitMQ
• Logs
• rabbitmqctl status
• rabbitmqctl environment
• rabbitmq-top (ships with RabbitMQ as of 3.6.3)
![Page 63: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/63.jpg)
Collecting data from RabbitMQ
• Logs
• rabbitmqctl status
• rabbitmqctl environment
• rabbitmq-top (ships with RabbitMQ as of 3.6.3)
• HTTP API (lots of metrics)
![Page 64: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/64.jpg)
http://{hostname}:15672/api
![Page 65: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/65.jpg)
curl -u guest:guest http://127.0.0.1:15672/api/overview | python -m json.tool curl -u guest:guest http://127.0.0.1:15672/api/nodes/{node} | python -m json.tool curl -u guest:guest http://127.0.0.1:15672/api/queues | python -m json.tool
![Page 66: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/66.jpg)
Collecting data from RabbitMQ
• Logs
• rabbitmqctl status
• rabbitmqctl environment
• rabbitmq-top (ships with RabbitMQ as of 3.6.3)
• HTTP API (lots of metrics)
• Message tracing ("firehose")
![Page 67: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/67.jpg)
Collecting data from RabbitMQ
• HTTP API (lots of metrics)
• Message tracing ("firehose")
• Infrastructure metrics
![Page 68: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/68.jpg)
![Page 69: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/69.jpg)
Common theme?
![Page 70: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/70.jpg)
Common theme?• Collect logs system-wide
![Page 71: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/71.jpg)
Common theme?• Collect logs system-wide
• Collect metrics system-wide
![Page 72: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/72.jpg)
Common theme?• Collect logs system-wide
• Collect metrics system-wide
• Collect exceptions system-wide
![Page 73: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/73.jpg)
Common theme?• Collect logs system-wide
• Collect metrics system-wide
• Collect exceptions system-wide
• Trace requests (e.g. with Zipkin)
![Page 74: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/74.jpg)
Common theme?• Collect logs system-wide
• Collect metrics system-wide
• Collect exceptions system-wide
• Trace requests (e.g. with Zipkin)
• Analyze
![Page 75: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/75.jpg)
![Page 76: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/76.jpg)
Common theme?• Collect logs system-wide
• Collect metrics system-wide
• Collect exceptions system-wide
• Trace requests (e.g. with Zipkin)
• Analyze
• Sounds like something a structured platform can help with!
![Page 77: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/77.jpg)
Distributed system debugging is a problem far from being solved.
![Page 78: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/78.jpg)
![Page 79: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/79.jpg)
Thank you
![Page 80: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/80.jpg)
Thank you• @michaelklishin
![Page 82: Troubleshooting RabbitMQ and Microservices That Use It](https://reader031.vdocument.in/reader031/viewer/2022030311/58ef01e51a28ab6d728b463b/html5/thumbnails/82.jpg)
Thank you• @michaelklishin
• github.com/michaelklishin