Source:
@Override public void run() throws Exception { client = new MqttClient(url, clientId, persistence); MqttConnectOptions connOpts = new MqttConnectOptions(); connOpts.setCleanSession(true); connOpts.setAutomaticReconnect(true); client.setCallback(new MqttCallbackExtended() { @Override public void connectComplete(boolean reconnect, String serverURI) { try { LOG.debug("Connected"); client.subscribe(topic, qos); } catch (MqttException e) { LOG.warn("Could not subsctibe to: " + topic); } } @Override public void connectionLost(Throwable cause) { LOG.debug("Disconnected"); } @Override public void messageArrived(String topic, MqttMessage message) throws Exception { GtfsRealtime.FeedMessage feedMessage; List<GtfsRealtime.FeedEntity> feedEntityList; List<GtfsRealtime.TripUpdate> updates = null; boolean fullDataset = true; try { feedMessage = GtfsRealtime.FeedMessage.PARSER.parseFrom(message.getPayload()); feedEntityList = feedMessage.getEntityList(); if (feedMessage.hasHeader() && feedMessage.getHeader().hasIncrementality() && feedMessage.getHeader().getIncrementality() .equals(GtfsRealtime.FeedHeader.Incrementality.DIFFERENTIAL)) { fullDataset = false; } updates = new ArrayList<>(feedEntityList.size()); for (GtfsRealtime.FeedEntity feedEntity : feedEntityList) { if (feedEntity.hasTripUpdate()) { updates.add(feedEntity.getTripUpdate()); } } } catch (InvalidProtocolBufferException e) { LOG.error("Could not decode gtfs-rt message:", e); } if (updates != null) { TripUpdateGraphWriterRunnable runnable = new TripUpdateGraphWriterRunnable( fullDataset, updates, feedId); updaterManager.execute(runnable); } } @Override public void deliveryComplete(IMqttDeliveryToken token) { } }); LOG.debug("Connecting to broker: " + url); client.connect(connOpts); }

Target:
@Override public void run() throws Exception { client = new MqttClient(url, clientId, persistence); MqttConnectOptions connOpts = new MqttConnectOptions(); connOpts.setCleanSession(true); connOpts.setAutomaticReconnect(true); client.setCallback(new MqttCallbackExtended() { @Override public void connectComplete(boolean reconnect, String serverURI) { try { LOG.debug("Connected"); client.subscribe(topic, qos); } catch (MqttException e) { LOG.warn("Could not subscribe to: " + topic); } } @Override public void connectionLost(Throwable cause) { LOG.debug("Disconnected"); } @Override public void messageArrived(String topic, MqttMessage message) throws Exception { GtfsRealtime.FeedMessage feedMessage; List<GtfsRealtime.FeedEntity> feedEntityList; List<GtfsRealtime.TripUpdate> updates = null; boolean fullDataset = true; try { feedMessage = GtfsRealtime.FeedMessage.PARSER.parseFrom(message.getPayload()); feedEntityList = feedMessage.getEntityList(); if (feedMessage.hasHeader() && feedMessage.getHeader().hasIncrementality() && feedMessage.getHeader().getIncrementality() .equals(GtfsRealtime.FeedHeader.Incrementality.DIFFERENTIAL)) { fullDataset = false; } updates = new ArrayList<>(feedEntityList.size()); for (GtfsRealtime.FeedEntity feedEntity : feedEntityList) { if (feedEntity.hasTripUpdate()) { updates.add(feedEntity.getTripUpdate()); } } } catch (InvalidProtocolBufferException e) { LOG.error("Could not decode gtfs-rt message:", e); } if (updates != null) { TripUpdateGraphWriterRunnable runnable = new TripUpdateGraphWriterRunnable( fullDataset, updates, feedId); updaterManager.execute(runnable); } } @Override public void deliveryComplete(IMqttDeliveryToken token) { } }); LOG.debug("Connecting to broker: " + url); client.connect(connOpts); }