A graph function must implement an undeliverableMessageHandler method that handles with any undeliverable vertex messages. The following example shows the GraphSearch implementation of the undeliverableMessageHandler method. The method simply issues a global halt if any undeliverable messages are received. Another option would have been for the method to log each message and return, thus allowing graph processing to proceed.
/** * If there are any undeliverable messages, then stop graph processing. * Alternatively, one can log messages and continued. * @param globals - provides the iteration number and other global state * @param undeliverableMessages - the messages that could not be delivered */ public void undeliverableMessagesHandler(GraphGlobals globals, VertexMessageIterator undeliverableMessages) { if (undeliverableMessages.advanceToNextMessage()){ globals.globalHalt(); } return; }