Skip to content

Minimal example using Spring Boot and Spring Kafka to connect to Azure Event Hubs

License

Notifications You must be signed in to change notification settings

stefan-hudelmaier/azure-event-hubs-kafka-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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:

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.

About

Minimal example using Spring Boot and Spring Kafka to connect to Azure Event Hubs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages