Fix FileInputStream resource leaks in RabbitMQ and MQTT SSL configurations#1838
Fix FileInputStream resource leaks in RabbitMQ and MQTT SSL configurations#1838Sunny-Hasho wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughUpdated RabbitMQ and MQTT inbound endpoint SSL setup to use try-with-resources when loading keystore and truststore files. This ensures the input streams are closed properly after use while leaving the existing connection and SSL initialization flow unchanged. No public API changes were introduced. WalkthroughThis change modifies keystore and truststore file loading in Changes
Related issues: None referenced in the provided information. Related PRs: None referenced in the provided information. Suggested labels: bug, dependencies Suggested reviewers: None specified. Poem 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Purpose
Fix file descriptor/resource leaks caused by unclosed
FileInputStreamobjects inside RabbitMQ and MQTT inbound endpoint configurations.Goals
Ensure all file input streams opened for loading SSL KeyStore and TrustStore files are properly closed after usage.
Approach
Refactored the SSL KeyStore and TrustStore loading logic in
RabbitMQConnectionFactory.javaandMqttConnectionFactory.javato use the standard try-with-resources statement. This is consistent with the resource handling patterns already used in other parts of this module (e.g.,SSLHandlerFactory.java).User stories
N/A
Release note
Fixed a file descriptor resource leak in RabbitMQ and MQTT inbound endpoint SSL configurations.
Documentation
N/A (No documentation impact as this is an internal resource management bug fix).
Automation tests
Security checks