Application The spring boot class that will contain spring boot's main method which is responsible for starting the application.Īs MQTT is a binary protocol we won't be able to rely on http headers to propagate the tracing context as we would normally do when applications use HTTP.MqttController The spring boot controller that will handle the http requests that will in turn trigger the MQTT calls.MessagingService this is the main place where all the tracing primitives are added for the publish/subscribe methods.MqttConfiguration which will hold the appropriate information to connect the MQTT client to the broker.The application is based on four java classes.The apikey.env file that will contain the API key required to authenticate the Datadog Agent to the platform (ex DD_API_KEY=6xxxxxxxxxxxxxxxxxxxxxxxxxx2).The various docker files needed to build the images and the docker-compose configuration to spin up the three containers ( dd-agent, mosquitto broker, spring boot app). The springbootmqtt directory that contains the entire springboot project.The main components of this project can be described as follows: The example below is the structure after having built the app.ĬOMP10619:springboot-mqtt pejman.tabassomi$ tree Your favorite text editor or IDE (Ex IntelliJ)Ĭlone the repository COMP10619:~ pejman.tabassomi$ git clone.This tutorial is meant to understand how the Datadog Java sdk ( dd-trace-ot.jar) can be used to efficiently instrument a Java Spring Boot application that interacts with a MQTT Broker. In each section, we'll describe the required steps to take in order to reach the goal. Building the docker images and run the application.The sections of this tutorial are structured as follows The purpose of this tutorial is to show how custom instrumentation can be implemented to trace a Java application using MQTT. Spring Boot and MQTT Tracing - Custom instrumentation working example
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |