https://github.com/stefan-hudelmaier/azure-event-hubs-kafka-example
Minimal example using Spring Boot and Spring Kafka to connect to Azure Event Hubs
https://github.com/stefan-hudelmaier/azure-event-hubs-kafka-example
azure event-hubs kafka spring-boot spring-kafka
Last synced: 2 months ago
JSON representation
Minimal example using Spring Boot and Spring Kafka to connect to Azure Event Hubs
- Host: GitHub
- URL: https://github.com/stefan-hudelmaier/azure-event-hubs-kafka-example
- Owner: stefan-hudelmaier
- License: apache-2.0
- Created: 2018-06-03T08:33:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-03T08:46:24.000Z (about 7 years ago)
- Last Synced: 2025-02-06T05:22:28.254Z (4 months ago)
- Topics: azure, event-hubs, kafka, spring-boot, spring-kafka
- Language: Java
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Azure Event Hubs Kafka Example
This is a minimal example using Spring Boot and Spring Kafka to connect to Azure Event Hubs via the Kafka protocol.
You can use the following guide to create a Kafka-enabled Event Hubs on Azure:
https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create-kafka-enabled
Create a topic aka Event Hub called `test-topic`
You now have to configure the following two Spring properties, e.g. in `application.yml`.
```$yml
event-hubs-connection-string: "Endpoint=sb://sth-event-hubs.servicebus.windows.net/;SharedAccessKeyName=sth-policy;SharedAccessKey=xxxxxx"
event-hubs-fqdn: "sth-event-hubs.servicebus.windows.net"
```You can send a test message using:
```$bash
curl http://127.0.0.1:8080/send-message
```Since the application listens for messages on `test-topic` you
should see the messages in the log. Note that it can take a couple of seconds for the application to subscribe.