diff --git a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/README.md b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/README.md index 5159253da..5b5fc311c 100644 --- a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/README.md +++ b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/README.md @@ -102,3 +102,8 @@ Also to allow your functions to scale properly on the Premium plan when using Ka } } ``` + +## References + +* [Apache Kafka for Confluent Cloud - Azure portal](https://learn.microsoft.com/en-us/azure/partner-solutions/apache-kafka-confluent-cloud/create) - show how to create an instance of Apache Kafka for Confluent Cloud. +- [Create a Cluster in Confluent Cloud](https://docs.confluent.io/cloud/current/clusters/create-cluster.html#create-a-cluster-in-ccloud) \ No newline at end of file diff --git a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/azure/local.settings.json b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/azure/local.settings.json index 7172b27d1..87b48b54b 100644 --- a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/azure/local.settings.json +++ b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/azure/local.settings.json @@ -7,6 +7,7 @@ "BrokerList": "localhost:9092", "ConfluentCloudUsername": "test", + "ConfluentCloudPassword": "test", "TriggerKafkaTopic": "trigger" } } \ No newline at end of file diff --git a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/KafkaTriggerDemoApplication.java b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/KafkaTriggerDemoApplication.java index 09eed0f5c..7b8d10a94 100644 --- a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/KafkaTriggerDemoApplication.java +++ b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/KafkaTriggerDemoApplication.java @@ -38,10 +38,6 @@ public class KafkaTriggerDemoApplication { public Function, String> uppercase(JsonMapper mapper) { return message -> { - // // (Optionally) access and use the Azure function context. - ExecutionContext context = (ExecutionContext) message.getHeaders().get("executionContext"); - context.getLogger().info("Kafka triggered with data: " + message.getPayload()); - // Convert the message payload into Azure's KafkaEntity format. KafkaEntity kafkaEntity = mapper.fromJson(message.getPayload(), KafkaEntity.class); diff --git a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/UppercaseHandler.java b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/UppercaseHandler.java index 87220f001..67973fa4e 100644 --- a/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/UppercaseHandler.java +++ b/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/UppercaseHandler.java @@ -39,7 +39,7 @@ public class UppercaseHandler extends FunctionInvoker, String> { brokerList = "%BrokerList%", consumerGroup = "$Default", username = "%ConfluentCloudUsername%", - password = "ConfluentCloudPassword", + password = "%ConfluentCloudPassword%", authenticationMode = BrokerAuthenticationMode.PLAIN, protocol = BrokerProtocol.PLAINTEXT, // protocol = BrokerProtocol.SASLSSL, @@ -50,11 +50,11 @@ public class UppercaseHandler extends FunctionInvoker, String> { topic = "output", brokerList="%BrokerList%", username = "%ConfluentCloudUsername%", - password = "ConfluentCloudPassword", + password = "%ConfluentCloudPassword%", authenticationMode = BrokerAuthenticationMode.PLAIN, // sslCaLocation = "confluent_cloud_cacert.pem", // Enable this line for windows. protocol = BrokerProtocol.PLAINTEXT - //protocol = BrokerProtocol.SASLSSL + // protocol = BrokerProtocol.SASLSSL ) OutputBinding output, final ExecutionContext context) {