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
NettyClientConfig.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.
|
io.seata.core.rpc.netty.NettyClientChannelManager |
getClientChannelManager() |
protected abstract Function<String,NettyPoolKey> |
getPoolKeyFunction()
Get pool key function.
|
TransactionMessageHandler |
getTransactionMessageHandler() |
protected abstract String |
getTransactionServiceGroup()
Get transaction service group.
|
void |
init() |
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
NettyClientConfig.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
RemotingClientNettyClientConfig.isEnableClientBatchSendRequest() is enabled,
the message will be sent in batches.sendSyncRequest 在接口中 RemotingClientmsg - transaction message io.seata.core.protocolTimeoutExceptionpublic Object sendSyncRequest(io.netty.channel.Channel channel, Object msg) throws TimeoutException
RemotingClientsendSyncRequest 在接口中 RemotingClientchannel - client channelmsg - transaction message io.seata.core.protocolTimeoutExceptionpublic 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 abstract Function<String,NettyPoolKey> getPoolKeyFunction()
protected abstract String getTransactionServiceGroup()
Copyright © 2020 Seata. All rights reserved.