Changes for Kafka AAF integration

Issue-ID: DMAAP-772
Change-Id: I60e07746c48967500f744f3fe9632d55197277bb
Signed-off-by: sunil unnava <sunil.unnava@att.com>
diff --git a/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java b/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java
index 735e372..c08d909 100644
--- a/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java
+++ b/src/main/java/com/att/dmf/mr/backends/kafka/KafkaPublisher.java
@@ -74,8 +74,10 @@
 		}
 		
 	
-	
-		
+	    
+		transferSetting( props, "sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required username='admin' password='admin_secret';");
+		transferSetting( props, "security.protocol", "SASL_PLAINTEXT");
+		transferSetting( props, "sasl.mechanism", "PLAIN");		
 		transferSetting( props, "bootstrap.servers",kafkaConnUrl);
 			
 		transferSetting( props, "request.required.acks", "1");
diff --git a/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaConsumerFactory.java b/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaConsumerFactory.java
index f60fd53..74f4ef6 100644
--- a/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaConsumerFactory.java
+++ b/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaConsumerFactory.java
@@ -290,7 +290,10 @@
 		props.put("group.id", fakeGroupName);
 		props.put("enable.auto.commit", "false"); // 0.11
 		props.put("bootstrap.servers", fkafkaBrokers);
-
+		props.put("sasl.jaas.config",
+				"org.apache.kafka.common.security.plain.PlainLoginModule required username='admin' password='admin_secret';");
+		props.put("security.protocol", "SASL_PLAINTEXT");
+		props.put("sasl.mechanism", "PLAIN");
 		
 		props.put("client.id", consumerId);
 
diff --git a/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaMetaBroker.java b/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaMetaBroker.java
index 4bef985..c89a3b2 100644
--- a/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaMetaBroker.java
+++ b/src/main/java/com/att/dmf/mr/beans/DMaaPKafkaMetaBroker.java
@@ -82,9 +82,10 @@
 			fkafkaBrokers = "localhost:9092";
 		}
 		
-		
-		
 	     props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, fkafkaBrokers );
+	     props.put("sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required username='admin' password='admin_secret';");
+	  	 props.put(AdminClientConfig.SECURITY_PROTOCOL_CONFIG, "SASL_PLAINTEXT");	     
+	     props.put("sasl.mechanism", "PLAIN");
 	   
 	     fKafkaAdminClient=AdminClient.create ( props );
 	    
@@ -118,7 +119,9 @@
 		}
 		
 		
-		
+		 props.put("sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required username='admin' password='admin_secret';");
+	  	 props.put(AdminClientConfig.SECURITY_PROTOCOL_CONFIG, "SASL_PLAINTEXT");	     
+	     props.put("sasl.mechanism", "PLAIN");
 	     props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, fkafkaBrokers );
 	     
 	     fKafkaAdminClient=AdminClient.create ( props );
diff --git a/src/test/java/com/att/nsa/cambria/embed/EmbedConfigurationReader.java b/src/test/java/com/att/nsa/cambria/embed/EmbedConfigurationReader.java
index 30cb460..228664b 100644
--- a/src/test/java/com/att/nsa/cambria/embed/EmbedConfigurationReader.java
+++ b/src/test/java/com/att/nsa/cambria/embed/EmbedConfigurationReader.java
@@ -97,7 +97,7 @@
             

             final Properties props = new Properties ();

     	     props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092" );

-    	    props.put("sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required username='admin' password='admin_secret'");

+    	     props.put("sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required username='admin' password='admin_secret'");

     	  	 props.put(AdminClientConfig.SECURITY_PROTOCOL_CONFIG, "SASL_PLAINTEXT");	     

     	     props.put("sasl.mechanism", "PLAIN");

     	     fKafkaAdminClient = AdminClient.create ( props );