This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.nio.ByteBuffer | |
import java.nio.charset.Charset | |
import com.amazonaws.services.kms.AWSKMSClientBuilder | |
import com.amazonaws.services.kms.model.DecryptRequest | |
import com.amazonaws.util.Base64 | |
object KMSDecryptionUtil { | |
private lazy val kmsClient = AWSKMSClientBuilder.defaultClient() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Properties | |
import scala.collection.JavaConverters._ | |
import org.apache.kafka.clients.consumer.{ConsumerConfig, ConsumerRecords, KafkaConsumer} | |
import org.apache.kafka.common.serialization.StringDeserializer | |
class Consumer(brokers: String, topic: String, groupId: String) { | |
val consumer = new KafkaConsumer[String, String](configuration) | |
consumer.subscribe(List(topic).asJava) |