private void handleClientExceptions(final Throwable clientException) { if (clientException != null) { this.isPumpHealthy = false; if (TRACE_LOGGER.isWarnEnabled()) { TRACE_LOGGER.warn(String.format( "Receive pump for eventHub (%s), consumerGroup (%s), partition (%s) exiting after receive exception %s", this.eventHubName, this.consumerGroupName, this.receiver.getPartitionId(), clientException.toString())); } this.onReceiveHandler.onError(clientException); } }
private void schedulePump() { try { this.executor.execute(this); } catch (final RejectedExecutionException rejectedException) { this.isPumpHealthy = false; if (TRACE_LOGGER.isWarnEnabled()) { TRACE_LOGGER.warn(String.format( "Receive pump for eventHub (%s), consumerGroup (%s), partition (%s) exiting with error: %s", this.eventHubName, this.consumerGroupName, ReceivePump.this.receiver.getPartitionId(), rejectedException.toString())); } this.onReceiveHandler.onError(rejectedException); } }
private void handleUserCodeExceptions(final Throwable userCodeException) { this.isPumpHealthy = false; if (TRACE_LOGGER.isErrorEnabled()) { TRACE_LOGGER.error( String.format("Receive pump for eventHub (%s), consumerGroup (%s), partition (%s) " + "exiting after user-code exception %s", this.eventHubName, this.consumerGroupName, this.receiver.getPartitionId(), userCodeException.toString())); } this.onReceiveHandler.onError(userCodeException); if (userCodeException instanceof InterruptedException) { if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info(String.format("Interrupting receive pump for eventHub (%s), consumerGroup (%s), partition (%s)", this.eventHubName, this.consumerGroupName, this.receiver.getPartitionId())); } Thread.currentThread().interrupt(); } }
public void triggerError(Map<SystemStreamPartition, PartitionReceiveHandler> handlers, Throwable e) { handlers.forEach((ssp, value) -> value.onError(e)); }