public abstract class AbstractNettyRemotingClient extends AbstractNettyRemoting implements RemotingClient
| 限定符和类型 | 字段和说明 |
|---|---|
protected ConcurrentHashMap<String,BlockingQueue<RpcMessage>> |
basketMap
When batch sending is enabled, the message will be stored to basketMap
Send via asynchronous thread
MergedSendRunnable
this#isEnableClientBatchSendRequest() |
protected Object |
mergeLock |
protected Map<Integer,MergeMessage> |
mergeMsgMap
When sending message type is
MergeMessage, will be stored to mergeMsgMap. |
futures, idGenerator, isSending, lock, messageExecutor, nowMills, processorTable, rpcHooks, timerExecutor| 构造器和说明 |
|---|
AbstractNettyRemotingClient(NettyClientConfig nettyClientConfig,
io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup,
ThreadPoolExecutor messageExecutor,
NettyPoolKey.TransactionRole transactionRole) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroy() |
void |
destroyChannel(String serverAddress,
io.netty.channel.Channel channel)
Destroy channel.
|
protected InetSocketAddress |
doSelect(List<InetSocketAddress> list,
Object msg) |
io.seata.core.rpc.netty.NettyClientChannelManager |
getClientChannelManager() |
protected abstract Function<String,NettyPoolKey> |
getPoolKeyFunction()
Get pool key function.
|
protected abstract long |
getRpcRequestTimeout()
get Rpc Request Timeout
|
TransactionMessageHandler |
getTransactionMessageHandler() |
protected abstract String |
getTransactionServiceGroup()
Get transaction service group.
|
protected String |
getXid(Object msg) |
void |
init() |
protected abstract boolean |
isEnableClientBatchSendRequest()
Whether to enable batch sending of requests, hand over to subclass implementation.
|
protected String |
loadBalance(String transactionServiceGroup,
Object msg) |
void |
registerProcessor(int requestCode,
RemotingProcessor processor,
ExecutorService executor)
register processor
|
void |
sendAsyncRequest(io.netty.channel.Channel channel,
Object msg)
client send async request.
|
void |
sendAsyncResponse(String serverAddress,
RpcMessage rpcMessage,
Object msg)
client send async response.
|
Object |
sendSyncRequest(io.netty.channel.Channel channel,
Object msg)
client send sync request.
|
Object |
sendSyncRequest(Object msg)
client send sync request.
|
void |
setTransactionMessageHandler(TransactionMessageHandler transactionMessageHandler) |
buildRequestMessage, buildResponseMessage, destroyChannel, doAfterRpcHooks, doBeforeRpcHooks, getAddressFromChannel, getAddressFromContext, getFutures, getGroup, getNextMessageId, processMessage, sendAsync, sendSync, setGroupclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonRegisterMsgFail, onRegisterMsgSuccessprotected final Object mergeLock
protected final Map<Integer,MergeMessage> mergeMsgMap
MergeMessage, will be stored to mergeMsgMap.protected final ConcurrentHashMap<String,BlockingQueue<RpcMessage>> basketMap
MergedSendRunnable
this#isEnableClientBatchSendRequest()public AbstractNettyRemotingClient(NettyClientConfig nettyClientConfig, io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup, ThreadPoolExecutor messageExecutor, NettyPoolKey.TransactionRole transactionRole)
public void init()
init 在类中 AbstractNettyRemotingpublic Object sendSyncRequest(Object msg) throws TimeoutException
RemotingClientRmNettyRemotingClient.isEnableClientBatchSendRequest()
TmNettyRemotingClient.isEnableClientBatchSendRequest()
is enabled, the message will be sent in batches.sendSyncRequest 在接口中 RemotingClientmsg - transaction message io.seata.core.protocolTimeoutException - TimeoutExceptionpublic Object sendSyncRequest(io.netty.channel.Channel channel, Object msg) throws TimeoutException
RemotingClientsendSyncRequest 在接口中 RemotingClientchannel - client channelmsg - transaction message io.seata.core.protocolTimeoutException - TimeoutExceptionpublic void sendAsyncRequest(io.netty.channel.Channel channel,
Object msg)
RemotingClientsendAsyncRequest 在接口中 RemotingClientchannel - client channelmsg - transaction message io.seata.core.protocolpublic void sendAsyncResponse(String serverAddress, RpcMessage rpcMessage, Object msg)
RemotingClientsendAsyncResponse 在接口中 RemotingClientserverAddress - server addressrpcMessage - rpc message from server requestmsg - transaction message io.seata.core.protocolpublic void registerProcessor(int requestCode,
RemotingProcessor processor,
ExecutorService executor)
RemotingClientregisterProcessor 在接口中 RemotingClientrequestCode - MessageTypeprocessor - RemotingProcessorexecutor - thread poolpublic void destroyChannel(String serverAddress, io.netty.channel.Channel channel)
AbstractNettyRemotingdestroyChannel 在类中 AbstractNettyRemotingserverAddress - the server addresschannel - the channelpublic void destroy()
destroy 在接口中 Disposabledestroy 在类中 AbstractNettyRemotingpublic void setTransactionMessageHandler(TransactionMessageHandler transactionMessageHandler)
public TransactionMessageHandler getTransactionMessageHandler()
public io.seata.core.rpc.netty.NettyClientChannelManager getClientChannelManager()
protected InetSocketAddress doSelect(List<InetSocketAddress> list, Object msg) throws Exception
Exceptionprotected abstract Function<String,NettyPoolKey> getPoolKeyFunction()
protected abstract String getTransactionServiceGroup()
protected abstract boolean isEnableClientBatchSendRequest()
protected abstract long getRpcRequestTimeout()
Copyright © 2022 Seata. All rights reserved.