val props: HashMap[String, String] = new HashMap()
props.put("schema.registry.url", "http://<your-event-hub>.servicebus.windows.net")
props.put("schema.registry.tenant.id", "<your-azure-ad-tenant-id>")
props.put("schema.registry.client.id", "<your-client-id>")
props.put("schema.registry.client.secret", "<your-client-secret>")
import org.apache.spark.eventhubs.{ ConnectionStringBuilder, EventHubsConf, EventPosition }
import org.apache.spark.sql.functions.{ explode, split }
val connectionString = ConnectionStringBuilder("Endpoint=sb://<your-event-hub>.servicebus.windows.net/;SharedAccessKeyName=<name>;SharedAccessKey=<your-access-key>;EntityPath=<your-topic>")
.setEventHubName("<your-topic>")
.build
val eventHubsConf = EventHubsConf(connectionString)
.setStartingPosition(EventPosition.fromStartOfStream)
Consume Events from Event Hub AMQP endpoint with Azure Schema Registry
We leverage the
azure-eventhubs-spark
endpoint to pull data from Event Hub, and parsing withfrom_avro
from the Schema Registry.Last refresh: Never