Skip to content
Snippets Groups Projects
Commit c12523e6 authored by OZGCloud's avatar OZGCloud
Browse files

fix command service configuration

parent 43f1bd15
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ import de.ozgcloud.apilib.common.command.grpc.CommandMapper; ...@@ -25,6 +25,7 @@ import de.ozgcloud.apilib.common.command.grpc.CommandMapper;
import de.ozgcloud.apilib.common.command.grpc.GrpcOzgCloudCommandService; import de.ozgcloud.apilib.common.command.grpc.GrpcOzgCloudCommandService;
import de.ozgcloud.apilib.file.dummy.DummyOzgCloudFileService; import de.ozgcloud.apilib.file.dummy.DummyOzgCloudFileService;
import de.ozgcloud.apilib.file.grpc.GrpcOzgCloudFileService; import de.ozgcloud.apilib.file.grpc.GrpcOzgCloudFileService;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangIdMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService; import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.dummy.DummyVorgangService; import de.ozgcloud.apilib.vorgang.dummy.DummyVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.GrpcOzgCloudVorgangService; import de.ozgcloud.apilib.vorgang.grpc.GrpcOzgCloudVorgangService;
...@@ -68,6 +69,15 @@ public class OzgCloudClientAutoConfiguration { ...@@ -68,6 +69,15 @@ public class OzgCloudClientAutoConfiguration {
return properties; return properties;
} }
@Bean
@ConditionalOnProperty("ozgcloud.command-manager.address")
GrpcChannelsProperties commandProperties() {
var properties = new GrpcChannelsProperties();
var clientMap = properties.getClient();
addCommandManager(clientMap);
return properties;
}
private void addVorgangManager(Map<String, GrpcChannelProperties> clientMap) { private void addVorgangManager(Map<String, GrpcChannelProperties> clientMap) {
var channelProps = new GrpcChannelProperties(); var channelProps = new GrpcChannelProperties();
channelProps.setAddress(vorgangManagerProperties.getAddress()); channelProps.setAddress(vorgangManagerProperties.getAddress());
...@@ -123,9 +133,14 @@ public class OzgCloudClientAutoConfiguration { ...@@ -123,9 +133,14 @@ public class OzgCloudClientAutoConfiguration {
return new DummyVorgangService(); return new DummyVorgangService();
} }
@Bean
OzgCloudVorgangIdMapper ozgCloudVorgangIdMapper() {
return Mappers.getMapper(OzgCloudVorgangIdMapper.class);
}
@Bean @Bean
@ConditionalOnProperty("ozgcloud.command-manager.address") @ConditionalOnProperty("ozgcloud.command-manager.address")
OzgCloudCommandService grpcCommandService(@GrpcClient("command-manager") CommandServiceBlockingStub commandServiceStub, OzgCloudCommandService grpcOzgCloudCommandService(@GrpcClient("command-manager") CommandServiceBlockingStub commandServiceStub,
CommandMapper commandMapper, OzgCloudCallContextProvider contextProvider) { CommandMapper commandMapper, OzgCloudCallContextProvider contextProvider) {
return new GrpcOzgCloudCommandService(commandServiceStub, commandMapper, contextProvider); return new GrpcOzgCloudCommandService(commandServiceStub, commandMapper, contextProvider);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment