examples/iot-nirvana/client/src/main/java/com/google/cloud/demo/iot/nirvana/client/IotDevice.java
/** Publish messages continuously to Cloud IoT Core. */
Publish messages continuously to Cloud IoT Core.
Publish messages continuously to Cloud IoT Core .
public void publish() throws ClientException, FormatException {
    int cityIndex = Integer.parseInt(getCityIndex());
    City city = TemperatureUtils.loadCity(cityIndex);
    publishMessages(city);
  }
public void publish ( ) throws ClientException , FormatException { int cityIndex = Integer . parseInt ( getCityIndex ( ) ) ; City city = TemperatureUtils . loadCity ( cityIndex ) ; publishMessages ( city ) ; }
Publish messages continuously to Cloud IoT Core.
Publish messages continuously to Cloud IoT Core .
// Load city metadata and start publishing messages