Why you need it?
Is your feature request related to a problem? Please describe in details
import io.seata.core.exception.TransactionException;
import io.seata.core.rpc.netty.RmNettyRemotingClient;
import io.seata.rm.RMClient;
import io.seata.tm.TMClient;
import io.seata.tm.api.GlobalTransaction;
import io.seata.tm.api.GlobalTransactionContext;
import org.apache.seata.api.service.OrderService;
import org.apache.seata.api.service.impl.AccountServiceImpl;
import org.apache.seata.api.service.impl.OrderServiceImpl;
import org.apache.seata.api.service.impl.StorageServiceImpl;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Method;
import java.sql.SQLException;
import java.util.concurrent.TimeUnit;
RmNettyRemotingClient rmNettyRemotingClient = RmNettyRemotingClient.getInstance();
Class<? extends RmNettyRemotingClient> rmRemoteClass = rmNettyRemotingClient.getClass();
ReflectionUtils.doWithFields(rmRemoteClass, field -> {
if (field.getName().equals("clientChannelManager")) {
field.setAccessible(true);
//channelManger
Object o = field.get(rmNettyRemotingClient);
Method reconnect;
try {
reconnect = o.getClass().getDeclaredMethod("reconnect", String.class);
reconnect.setAccessible(true);
reconnect.invoke(o, "my_test_tx_group");
} catch (Exception e) {
throw new RuntimeException("reconnect failed!", e);
}
}
});
- To do a health check, it is very strange to have to use reflection.
How it could be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.
- No sure. Maybe expose the relevant API on the seata client side?
Other related information
Add any other context or screenshots about the feature request here.
Why you need it?
Is your feature request related to a problem? Please describe in details
org.apache.seata.api.BusinessServicewas calling a non-public Java API to do health checks. Refer to https://github.com/apache/incubator-seata-samples/blob/3ae0a30e94ccb76eabf8ffc15863dbfa29bda598/at-sample/at-api/src/main/java/org/apache/seata/api/BusinessService.java .How it could be?
A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.
Other related information
Add any other context or screenshots about the feature request here.