zhfeng commented on code in PR #3731:
URL: https://github.com/apache/camel-quarkus/pull/3731#discussion_r850983380


##########
integration-tests/paho-mqtt5/src/main/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Resource.java:
##########
@@ -68,13 +70,17 @@ public class PahoMqtt5Resource {
     public String consumePahoMessage(
             @PathParam("protocol") String protocol,
             @PathParam("queueName") String queueName) {
+        String tmpKeystore = null;
+
         if ("ssl".equals(protocol)) {
-            setKeyStore(keystore, password);
+            tmpKeystore = setKeyStore(keystore, password);
         }
+
         String result = consumerTemplate.receiveBody("paho-mqtt5:" + queueName 
+ "?brokerUrl=" + brokerUrl(protocol), 5000,
                 String.class);
-        if ("ssl".equals(protocol)) {
-            removeKeyStore(keystore);
+
+        if ("ssl".equals(protocol) && tmpKeystore != null) {
+            removeKeyStore(tmpKeystore);

Review Comment:
   yeah, it works.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to