这是基于vue-vben-admin 模板适用于abp Vnext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.4 KiB

LINGYUN.Abp.Dapr.Client

实现了Dapr文档中的服务间调用,项目设计与Volo.Abp.Http.Client一致,通过配置文件即可无缝替代Volo.Abp.Http.Client

配置参考 AbpRemoteServiceOptions

配置使用

模块按需引用

[DependsOn(typeof(AbpDaprClientModule))]
public class YouProjectModule : AbpModule
{
	public override void ConfigureServices(ServiceConfigurationContext context)
    {
        // 注册代理类似于 Volo.Abp.Http.Client 模块
        context.Services.AddDaprClientProxies(
            typeof(YouProjectActorInterfaceModule).Assembly, // 搜索 YouProjectActorInterfaceModule 模块下的远程服务定义
            RemoteServiceName
        );
    }
}

配置项说明

  • AbpDaprClientOptions.GrpcEndpoint Dapr暴露的Grpc端点, 对应 DaprClientBuilder.GrpcEndpoint

  • AbpDaprClientOptions.HttpEndpoint Dapr暴露的Http端点, 对应 DaprClientBuilder.HttpEndpoint

  • AbpDaprClientOptions.GrpcChannelOptions 通过Grpc调用远程服务的配置项, 对应 DaprClientBuilder.GrpcChannelOptions

  • AbpDaprRemoteServiceOptions.RemoteServices 配置Dapr.AppId


{
    "Dapr": {
        "Client": {
            "HttpEndpoint": "http://127.0.0.1:50000"
        }
    },
    "RemoteServices": {
        "System": {
            "AppId": "myapp"
        }
    }
}

其他