This commit is contained in:
parent
d9d87bdab0
commit
6d188d81df
|
|
@ -24,11 +24,14 @@ import org.apache.dubbo.rpc.Invoker;
|
|||
import org.apache.dubbo.rpc.Result;
|
||||
import org.apache.dubbo.rpc.RpcContext;
|
||||
import org.apache.dubbo.rpc.RpcException;
|
||||
import org.apache.dubbo.rpc.RpcInvocation;
|
||||
import org.apache.dubbo.rpc.cluster.Directory;
|
||||
import org.apache.dubbo.rpc.cluster.LoadBalance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.dubbo.rpc.Constants.ASYNC_KEY;
|
||||
|
||||
/**
|
||||
* BroadcastClusterInvoker
|
||||
*/
|
||||
|
|
@ -66,7 +69,9 @@ public class BroadcastClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
int failIndex = 0;
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
try {
|
||||
result = invokeWithContext(invoker, invocation);
|
||||
RpcInvocation subInvocation = new RpcInvocation(invocation, invoker);
|
||||
subInvocation.setAttachment(ASYNC_KEY, "true");
|
||||
result = invokeWithContext(invoker, subInvocation);
|
||||
if (null != result && result.hasException()) {
|
||||
Throwable resultException = result.getException();
|
||||
if (null != resultException) {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.dubbo.rpc;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||
import org.apache.dubbo.common.utils.ReflectUtils;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
import org.apache.dubbo.rpc.model.FrameworkModel;
|
||||
|
|
@ -112,7 +113,9 @@ public class RpcInvocation implements Invocation, Serializable {
|
|||
public RpcInvocation(Invocation invocation, Invoker<?> invoker) {
|
||||
this(invocation.getTargetServiceUniqueName(), invocation.getServiceModel(), invocation.getMethodName(), invocation.getServiceName(),
|
||||
invocation.getProtocolServiceKey(), invocation.getParameterTypes(), invocation.getArguments(),
|
||||
Collections.synchronizedMap(invocation.getObjectAttachments()), invocation.getInvoker(), invocation.getAttributes(),
|
||||
CollectionUtils.isEmptyMap(invocation.getObjectAttachments()) ?
|
||||
Collections.synchronizedMap(new HashMap<>()) : Collections.synchronizedMap(invocation.getObjectAttachments()),
|
||||
invocation.getInvoker(), invocation.getAttributes(),
|
||||
invocation instanceof RpcInvocation ? ((RpcInvocation) invocation).getInvokeMode() : null);
|
||||
if (invoker != null) {
|
||||
URL url = invoker.getUrl();
|
||||
|
|
|
|||
Loading…
Reference in New Issue