/*
* Sender checked and decided that the target is local so we simply put the event in the queue and
* we save the trip over the network.
*/
queue.put(new EventMessage(String.valueOf(event.getAppId()), event.getStreamName(), app
.getSerDeser().serialize(event)));
}
} else {
/*
* We are broadcasting this event to all PE instance. In a cluster, we need to send the event to every
* node. The sender method takes care of the remote partitions an we take care of putting the event into
* the queue.
*/
sender.sendToRemotePartitions(event);
queue.put(new EventMessage(String.valueOf(event.getAppId()), event.getStreamName(), app.getSerDeser()
.serialize(event)));
}
} catch (InterruptedException e) {
logger.error("Interrupted while waiting to put an event in the queue: {}.", e.getMessage());
Thread.currentThread().interrupt();