[ https://issues.apache.org/jira/browse/SCB-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307731#comment-16307731 ]
ASF GitHub Bot commented on SCB-149: ------------------------------------ WillemJiang commented on a change in pull request #95: [SCB-149] service aware callback URL: https://github.com/apache/incubator-servicecomb-saga/pull/95#discussion_r159177874 ########## File path: alpha/alpha-core/src/main/java/io/servicecomb/saga/alpha/core/RetryOmegaCallback.java ########## @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.servicecomb.saga.alpha.core; + +import java.lang.invoke.MethodHandles; +import java.util.concurrent.TimeUnit; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RetryOmegaCallback implements OmegaCallback { + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private static final String ERROR_MESSAGE = "Failed to compensate service [{}] instance [{}] with method [{}], global tx id [{}] and local tx id [{}]"; + + private final OmegaCallback underlying; + private final int delay; + + public RetryOmegaCallback(OmegaCallback underlying, int delay) { + this.underlying = underlying; + this.delay = delay; + } + + @Override + public void compensate(TxEvent event) { Review comment: The calling thread is blocked, we may need to think for another way to do it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > [pack] service/instance aware omega callback > -------------------------------------------- > > Key: SCB-149 > URL: https://issues.apache.org/jira/browse/SCB-149 > Project: Apache ServiceComb > Issue Type: Improvement > Components: Saga > Reporter: Yin Xiang > Assignee: Yin Xiang > > as a user, i want to compensate the service instance which initiated the > sub-transaction, if it's reachable from alpha, so that i can have stateful > service. > if that service instance is not reachable, other service instances are > allowed. -- This message was sent by Atlassian JIRA (v6.4.14#64029)