Orange-OpenSource / its-client

This Intelligent Transportation Systems (ITS) MQTT client based on the JSon ETSI specification transcription provides a ready to connect project for the mobility (connected and autonomous vehicles, road side units, vulnerable road users,...). Let's connect your device or application to our Intelligent Transport Systems (ITS) platform!
MIT License
7 stars 8 forks source link

Java/iot3core: send messages to telemetry service for MQTT exchanges #181

Closed mathieu1fb closed 1 month ago

mathieu1fb commented 1 month ago

Features;

IoT3 Core SDK: Telemetry is now operational when publishing and receiving MQTT messages, using the OpenTelemetry client: service_name, span.status, span.name, span.kind, attributes and links are all set according to the specification (see #128).

Closes: #128


How to test

  1. Clone the its-client project on your IDE.
  2. Ensure that you have Gradle to be able to build the java/iot3 modules (core, mobility and examples).
  3. Find the Iot3CoreExample class in the examples module, and set appropriate values for the following fields:
    // MQTT parameters
    private static final String EXAMPLE_MQTT_HOST = "mqtt_host";
    private static final int EXAMPLE_MQTT_PORT_TCP = 1883;
    private static final int EXAMPLE_MQTT_PORT_TLS = 8883;
    private static final String EXAMPLE_MQTT_USERNAME = "mqtt_username";
    private static final String EXAMPLE_MQTT_PASSWORD = "mqtt_password";
    private static final String EXAMPLE_MQTT_CLIENT_ID = "mqtt_client_id";
    // OpenTelemetry parameters
    private static final String EXAMPLE_OTL_HOST = "telemetry_host";
    private static final int EXAMPLE_OTL_PORT = 4318;
    private static final String EXAMPLE_OTL_ENDPOINT = "/telemetry/endpoint";
    private static final String EXAMPLE_OTL_USERNAME = "telemetry_username";
    private static final String EXAMPLE_OTL_PASSWORD = "telemetry_password";
  4. Run Iot3CoreExample.

Expected results:

  1. On the console, you should see 3 messages being published at 2 seconds interval, on 3 different topics: The first and third messages should be received back, while the second should not be.
  2. In Jaeger, you should be able to find the logs of the 3 published messages, and of the 2 received messages with links to the respective published ones.