J

Java_DataWorker_Sample

This java sample code of DataWorker for developer quick start. Including subscribe/publish message from IoTHub and access database.

Java_DataWorker_Sample

Enviroment

Developers

  • Clone the code and navigate to ./Java_DataWorker_Sample/SampleCode folder

    cd ./Java_DataWorker_Sample/SampleCode
    
  • Open SampleCode.java under ./Java_DataWorker_Sample/SampleCode/src/main/java and modify some codes about username and password

  • Run gradle command to build jar file

    gradlew runnableJar
    
  • Lunch Java_DataWorker_Sample via command on your PC

    java -jar ./Java_DataWorker_Sample/SampleCode/build/libs/SampleCode.jar
    

Cloud Foundry

  • Prerequisites

    • CF Command
    • Check the buildpack java_buildpack_offline exists in cf buildpacks list.
    • Check rabbitmq, postgrsql and mongodb service instance are in cf services.
  • Create manifest.yml file

    gradlew makeManifest
    
  • Push Application to PCF

    cf push -f manifest.yml
    

Test data