Commit 0b4295d8 authored by Luca Arrotta's avatar Luca Arrotta

README added

parent 08bdae2c
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
# Setup REST and MQTT # Setup REST and MQTT
\ No newline at end of file
* You can import the project directly from a **V**ersion **C**ontrol **S**ystem, by providing the following URL:
https://ewserver.di.unimi.it/gitlab/riccardopresotto/setup\_test_sdp.git
<img src = './assets/img_1.png'>
* Otherwise, take care to import the project as a Gradle Project
## REST
* Run StartServer.java located in: *REST\_MQTT_example/src/main/java/REST/*
* Use a REST Client application (i.e., Advanced REST Client) to test if the server works correctly
* For example you can run the following request:
<img src = './assets/img_2.jpeg'>
## MQTT
* Dowload and install the Mosquitto broker from here: *https://mosquitto.org/download/*
* Run the Mosquitto broker:
* **MacOS**
- brew services start mosquitto
- mosquitto_sub -h localhost -v -t ‘#’ *(Instead ‘#’ specify the topics of interest)*
* **Windows**
- Run the file mosquitto.exe
* Run SubExample.java and PubExample.java located in *REST\_MQTT_example/src/main/java/MQTT/*
...@@ -15,7 +15,8 @@ dependencies { ...@@ -15,7 +15,8 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
//start GRPC // GRPC Dependencies
/*
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java // https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.10.0' compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.10.0'
...@@ -48,17 +49,18 @@ dependencies { ...@@ -48,17 +49,18 @@ dependencies {
compile group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1' compile group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'
// https://mvnrepository.com/artifact/com.sun.jersey/jersey-server // https://mvnrepository.com/artifact/com.sun.jersey/jersey-server
compile group: 'com.sun.jersey', name: 'jersey-server', version: '1.2' compile group: 'com.sun.jersey', name: 'jersey-server', version: '1.2'
//end REST
*/
//start MQTT
// MQTT Dependencies
// https://mvnrepository.com/artifact/org.eclipse.paho/org.eclipse.paho.client.mqttv3 // https://mvnrepository.com/artifact/org.eclipse.paho/org.eclipse.paho.client.mqttv3
compile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version: '1.2.5' compile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version: '1.2.5'
//end MQTT //end MQTT
} }
//start GRPC /* GRPC stuff
sourceSets { sourceSets {
main { main {
java { java {
...@@ -86,7 +88,7 @@ protobuf { ...@@ -86,7 +88,7 @@ protobuf {
} }
} }
//end GRPC */
test { test {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment