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

OZG-6099 update processor-manager; handle if context user missing; don't creat...

OZG-6099 update processor-manager; handle if context user missing; don't creat bean for processor-manager
parent 410d51f6
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<user-manager-interface.version>2.1.0</user-manager-interface.version> <user-manager-interface.version>2.1.0</user-manager-interface.version>
<bescheid-manager.version>1.13.0</bescheid-manager.version> <bescheid-manager.version>1.13.0</bescheid-manager.version>
<processor-manager.version>0.4.0</processor-manager.version> <processor-manager.version>0.4.1-SNAPSHOT</processor-manager.version>
<nachrichten-manager.version>2.9.0</nachrichten-manager.version> <nachrichten-manager.version>2.9.0</nachrichten-manager.version>
<ozgcloud-starter.version>0.10.0</ozgcloud-starter.version> <ozgcloud-starter.version>0.10.0</ozgcloud-starter.version>
<notification-manager.version>2.8.0</notification-manager.version> <notification-manager.version>2.8.0</notification-manager.version>
......
...@@ -31,6 +31,7 @@ import org.springframework.stereotype.Component; ...@@ -31,6 +31,7 @@ import org.springframework.stereotype.Component;
import de.ozgcloud.apilib.common.callcontext.CallContext; import de.ozgcloud.apilib.common.callcontext.CallContext;
import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider; import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider;
import de.ozgcloud.apilib.user.OzgCloudUserId; import de.ozgcloud.apilib.user.OzgCloudUserId;
import de.ozgcloud.vorgang.callcontext.CallContextUser;
import de.ozgcloud.vorgang.callcontext.CurrentUserService; import de.ozgcloud.vorgang.callcontext.CurrentUserService;
import de.ozgcloud.vorgang.callcontext.VorgangManagerClientCallContextAttachingInterceptor; import de.ozgcloud.vorgang.callcontext.VorgangManagerClientCallContextAttachingInterceptor;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -45,11 +46,11 @@ public class VorgangManagerCallContextProvider implements OzgCloudCallContextPro ...@@ -45,11 +46,11 @@ public class VorgangManagerCallContextProvider implements OzgCloudCallContextPro
@Override @Override
public CallContext provideContext() { public CallContext provideContext() {
var callContextBuilder = CallContext.builder().clientName(VorgangManagerClientCallContextAttachingInterceptor.VORGANG_MANAGER_CLIENT_NAME); var callContextBuilder = CallContext.builder().clientName(VorgangManagerClientCallContextAttachingInterceptor.VORGANG_MANAGER_CLIENT_NAME);
getUserId().ifPresent(callContextBuilder::userId); findUserId().ifPresent(callContextBuilder::userId);
return callContextBuilder.build(); return callContextBuilder.build();
} }
Optional<OzgCloudUserId> getUserId() { Optional<OzgCloudUserId> findUserId() {
return currentUserService.getUser().getUserId().map(OzgCloudUserId::from); return currentUserService.findUser().flatMap(CallContextUser::getUserId).map(OzgCloudUserId::from);
} }
} }
...@@ -7,29 +7,15 @@ import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider; ...@@ -7,29 +7,15 @@ import de.ozgcloud.apilib.common.callcontext.OzgCloudCallContextProvider;
import de.ozgcloud.apilib.user.GrpcOzgCloudUserProfileService; import de.ozgcloud.apilib.user.GrpcOzgCloudUserProfileService;
import de.ozgcloud.apilib.user.OzgCloudUserProfileService; import de.ozgcloud.apilib.user.OzgCloudUserProfileService;
import de.ozgcloud.apilib.user.UserProfileMapper; import de.ozgcloud.apilib.user.UserProfileMapper;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.GrpcOzgCloudVorgangService;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangMapper;
import de.ozgcloud.apilib.vorgang.grpc.OzgCloudVorgangStubMapper;
import de.ozgcloud.user.grpc.userprofile.UserProfileServiceGrpc.UserProfileServiceBlockingStub; import de.ozgcloud.user.grpc.userprofile.UserProfileServiceGrpc.UserProfileServiceBlockingStub;
import de.ozgcloud.vorgang.vorgang.VorgangServiceGrpc.VorgangServiceBlockingStub;
import net.devh.boot.grpc.client.inject.GrpcClient; import net.devh.boot.grpc.client.inject.GrpcClient;
@Configuration @Configuration
class VorgangProcessorConfiguration { class VorgangProcessorConfiguration {
@GrpcClient("vorgang-manager")
private VorgangServiceBlockingStub vorgangServiceStub;
@GrpcClient("user-manager") @GrpcClient("user-manager")
private UserProfileServiceBlockingStub userProfileServiceGrpc; private UserProfileServiceBlockingStub userProfileServiceGrpc;
@Bean
OzgCloudVorgangService ozgCloudVorgangService(OzgCloudVorgangMapper mapper, OzgCloudVorgangStubMapper stubMapper,
OzgCloudCallContextProvider contextProvider) {
return new GrpcOzgCloudVorgangService(vorgangServiceStub, mapper, stubMapper, contextProvider);
}
@Bean @Bean
OzgCloudUserProfileService ozgCloudUserProfileService(UserProfileMapper mapper, OzgCloudCallContextProvider contextProvider) { OzgCloudUserProfileService ozgCloudUserProfileService(UserProfileMapper mapper, OzgCloudCallContextProvider contextProvider) {
return new GrpcOzgCloudUserProfileService(userProfileServiceGrpc, mapper, contextProvider); return new GrpcOzgCloudUserProfileService(userProfileServiceGrpc, mapper, contextProvider);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment