protected void doAsyncTask()

in app/eventgenerator/src/main/java/com/googlecodesamples/cloud/jss/eventgenerator/task/MessageTask.java [35:44]


  protected void doAsyncTask() throws InterruptedException, ExecutionException, IOException {
    // Generate a random event.
    Event event = MessageUtil.genRandomEvent();
    // Covert the event to Cloud Pub/Sub compatible format.
    PubsubMessage message = MessageUtil.convertToPubSubMessage(event, Event.getClassSchema());
    BasePublisherService service = getService();

    // Publish the message.
    service.publishMsg(message);
  }