Big Data, Spark, Event Hub, Scala, Azure.
var lowestStatusId = Long.MaxValue for (status <- statuses.asScala) { if(status.isRetweet()){ sendEvent(status.getRetweetedStatus().getText()) } else { sendEvent(status.getText()) } lowestStatusId = Math.min(status.getId(), lowestStatusId) Thread.sleep(2000) } query.setMaxId(lowestStatusId - 1) }