You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/10/20 12:30:29 UTC
[camel-kamelets-examples] 01/03: Azure Schema Registry: Add an example with Kamelet too to consume from Azure Eventhubs Kafka
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch kafka-azure-schema-fixed
in repository https://gitbox.apache.org/repos/asf/camel-kamelets-examples.git
commit dc163c79268629720a10d07b1d4200b1ec7d405b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Oct 20 14:19:34 2023 +0200
Azure Schema Registry: Add an example with Kamelet too to consume from Azure Eventhubs Kafka
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
.../kafka-kamelet-log.yaml | 43 ++++++++++++++++++++++
.../main.tf | 4 +-
2 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/jbang/azure-eventhubs-kafka-azure-schema-registry/kafka-kamelet-log.yaml b/jbang/azure-eventhubs-kafka-azure-schema-registry/kafka-kamelet-log.yaml
new file mode 100644
index 0000000..1e13d04
--- /dev/null
+++ b/jbang/azure-eventhubs-kafka-azure-schema-registry/kafka-kamelet-log.yaml
@@ -0,0 +1,43 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+# camel-k: dependency=mvn:com.acme.example:azure-identity:0.1
+
+- beans:
+ - name: defaultAzureCredential
+ type: "com.acme.example.azure.DefaultAzureCredentialWrapper"
+ - name: order
+ type: "com.acme.example.eventhubs.models.Order"
+
+- route:
+ id: "kafka-to-log"
+ from:
+ uri: "kamelet:kafka-azure-schema-registry-source"
+ parameters:
+ topic: "{{topic}}"
+ bootstrapServers: "{{bootstrap.servers}}"
+ consumerGroup: 'azure-consumer-group'
+ password: "{{password}}"
+ azureRegistryUrl: '{{schema.registry.url}}'
+ specificAvroValueType: 'com.acme.example.eventhubs.models.Order'
+ steps:
+ - to:
+ uri: "kamelet:log-sink"
+ parameters:
+ showStreams: true
+ showHeaders: true
+ multiline: true
diff --git a/jbang/azure-eventhubs-kafka-azure-schema-registry/main.tf b/jbang/azure-eventhubs-kafka-azure-schema-registry/main.tf
index d0da4a2..8337e17 100644
--- a/jbang/azure-eventhubs-kafka-azure-schema-registry/main.tf
+++ b/jbang/azure-eventhubs-kafka-azure-schema-registry/main.tf
@@ -39,7 +39,7 @@ resource "azurerm_resource_group" "example" {
# Eventhubs Namepsace.
resource "azurerm_eventhub_namespace" "example" {
- name = "example-namespace"
+ name = "example-test12345-namespace"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
sku = "Standard"
@@ -72,4 +72,4 @@ resource "azurerm_eventhub_namespace_schema_group" "example" {
namespace_id = azurerm_eventhub_namespace.example.id
schema_compatibility = "Forward"
schema_type = "Avro"
-}
\ No newline at end of file
+}