diff --git a/flume-ng-sources/flume-jms-source/src/main/java/org/apache/flume/source/jms/JMSSource.java b/flume-ng-sources/flume-jms-source/src/main/java/org/apache/flume/source/jms/JMSSource.java index 43df145187..75150fdabb 100644 --- a/flume-ng-sources/flume-jms-source/src/main/java/org/apache/flume/source/jms/JMSSource.java +++ b/flume-ng-sources/flume-jms-source/src/main/java/org/apache/flume/source/jms/JMSSource.java @@ -170,7 +170,12 @@ protected void doConfigure(Context context) throws FlumeException { String passwordFile = context.getString(JMSSourceConfiguration.PASSWORD_FILE, "").trim(); if (passwordFile.isEmpty()) { - password = Optional.absent(); + if (userName.isPresent()){ + logger.warn("passwordFile property is not set but userName property is set. Setting password to default value"); + password = Optional.of(""); + }else{ + password = Optional.absent(); + } } else { try { password = Optional.of(Files.toString(new File(passwordFile),