org.springframework.retry.annotation.Recover Java Examples

The following examples show how to use org.springframework.retry.annotation.Recover. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultRefreshWatcher.java    From super-cloudops with Apache License 2.0 5 votes vote down vote up
/**
 * Report retries exceed count exception.
 *
 * @param e
 */
@Recover
public void recoverReportRetriesCountOutException(ReportRetriesCountOutException e) {
	if (thresholdFastfail) {
		if (log.isWarnEnabled()) {
			log.warn("Refresh report retries exceed threshold, discarded refresh changed record!");
		}
		pollChangedAll();
	} else if (log.isWarnEnabled()) {
		log.warn("Refresh report retries exceed threshold!");
	}
}
 
Example #2
Source File: RemoteService.java    From retry with Apache License 2.0 4 votes vote down vote up
/**
 * 补偿机制
 * @param e 异常
 */
@Recover
public void recover(RuntimeException e) {
    LOGGER.info("Start do recover things....");
    LOGGER.warn("We meet ex: ", e);
}
 
Example #3
Source File: TimeService.java    From retry with Apache License 2.0 4 votes vote down vote up
/**
 * 补偿机制
 *
 * @param e 异常
 */
@Recover
public void recover(RuntimeException e, CbTime cbTime) {
    LOGGER.info("开始处理回复工作: " + cbTime);
    LOGGER.warn("We meet ex: ", e);
}
 
Example #4
Source File: InstanceInitializeService.java    From api-layer with Eclipse Public License 2.0 4 votes vote down vote up
@Recover
public void recover(RetryException e) {
    apimlLog.log("org.zowe.apiml.apicatalog.initializeFailed");
}
 
Example #5
Source File: MailService.java    From spring-boot-ignite with Apache License 2.0 4 votes vote down vote up
/**
  * The recover method needs to have same return type and parameters.
  *
  * @return
  */
@Recover
 private boolean fallbackForCall() {
     logger.error("Fallback for mail service call invoked, mail service is NOT reachable");
     return false;
 }
 
Example #6
Source File: TextUnitSearcher.java    From mojito with Apache License 2.0 4 votes vote down vote up
@Recover
public TextUnitAndWordCount recoverCountTextUnitAndWordCount(TextUnitSearcherError textUnitSearcherError, TextUnitSearcherParameters searchParameters) throws Throwable {
    logTextUnitSearcherError(textUnitSearcherError);
    throw textUnitSearcherError.getCause();
}
 
Example #7
Source File: TextUnitSearcher.java    From mojito with Apache License 2.0 4 votes vote down vote up
@Recover
public List<TextUnitDTO> recoverSearch(TextUnitSearcherError textUnitSearcherError, TextUnitSearcherParameters searchParameters) throws Throwable {
    logTextUnitSearcherError(textUnitSearcherError);
    throw textUnitSearcherError.getCause();
}
 
Example #8
Source File: RetryAndRecoverService.java    From blog-examples with Apache License 2.0 4 votes vote down vote up
@Recover
public void recover(FooException exception) {
    System.out.println("recovering from " + exception);
}
 
Example #9
Source File: MyService.java    From tutorials with MIT License 4 votes vote down vote up
@Recover
void recover(SQLException e, String sql);
 
Example #10
Source File: MirrorNodeClient.java    From hedera-mirror-node with Apache License 2.0 3 votes vote down vote up
/**
 * Recover method of subscribeToTopicAndRetrieveMessages retry logic. Method parameters of retry method must match
 * this method after exception parameter
 *
 * @param t
 * @param mirrorConsensusTopicQuery
 * @param numMessages
 * @param latency
 * @throws InterruptedException
 */
@Recover
public void recover(StatusRuntimeException t, MirrorConsensusTopicQuery mirrorConsensusTopicQuery,
                    int numMessages,
                    long latency) throws InterruptedException {
    log.error("Subscription w retry failure: {}", t.getMessage());
    throw t;
}
 
Example #11
Source File: TopicFeature.java    From hedera-mirror-node with Apache License 2.0 2 votes vote down vote up
/**
 * Recover method for retry operations Method parameters of retry method must match this method after exception
 * parameter
 *
 * @param t
 */
@Recover
public void recover(StatusRuntimeException t) {
    log.error("Transaction submissions for topic operation failed after retries w: {}", t.getMessage());
    throw t;
}
 
Example #12
Source File: TopicFeature.java    From hedera-mirror-node with Apache License 2.0 2 votes vote down vote up
/**
 * Recover method for publishTopicMessages retry operations. Method parameters of retry method must match this
 * method after exception parameter
 *
 * @param t
 */
@Recover
public void recover(StatusRuntimeException t, int messageCount) {
    log.error("Transaction submissions for message publish failed after retries w: {}", t.getMessage());
    throw t;
}
 
Example #13
Source File: TopicFeature.java    From hedera-mirror-node with Apache License 2.0 2 votes vote down vote up
/**
 * Recover method for publishTopicMessages retry operations. Method parameters of retry method must match this
 * method after exception parameter
 *
 * @param t
 */
@Recover
public void recover(StatusRuntimeException t, int numGroups, int messageCount, long milliSleep) {
    log.error("Transaction submissions for message publish failed after retries w: {}", t.getMessage());
    throw t;
}
 
Example #14
Source File: MirrorNodeClient.java    From hedera-mirror-node with Apache License 2.0 2 votes vote down vote up
/**
 * Recover method of subscribeToTopic retry logic. Method parameters of retry method must match this method after
 * exception parameter
 *
 * @param t
 * @param mirrorConsensusTopicQuery
 * @throws InterruptedException
 */
@Recover
public void recover(StatusRuntimeException t, MirrorConsensusTopicQuery mirrorConsensusTopicQuery) throws InterruptedException {
    log.error("Subscription w retry failure: {}", t.getMessage());
    throw t;
}
 
Example #15
Source File: ExternalServiceWithSpringRetryAndCircuitBreaker.java    From spring-boot-quickstart-archtype with Apache License 2.0 2 votes vote down vote up
/**
 * The recover method needs to have same return type and parameters which will be called in case the circuit is closed or retrials are over
 * so this the fallback logic
 *
 * @return
 */
@Recover
private void fallbackForCall() {
    log.error("Fallback for external service call invoked, the external service is NOT reachable");
}