Pull request #609: RED-5277: Fixed Message Deserialization in Ner/Image service resonse
Merge in RED/persistence-service from RED-5277 to master * commit '7212012cd69a0924b734951de055237d89b20346': RED-5277: Fixed Message Deserialization in Ner/Image service resonse
This commit is contained in:
commit
a428aa4c8a
@ -1,6 +1,5 @@
|
||||
package com.iqser.red.service.peristence.v1.server.service;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
@ -13,7 +12,6 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.iqser.red.service.peristence.v1.server.configuration.MessagingConfiguration;
|
||||
import com.iqser.red.service.peristence.v1.server.settings.FileManagementServiceSettings;
|
||||
import com.iqser.red.service.persistence.service.v1.api.model.dossiertemplate.dossier.file.FileType;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
@ -33,16 +31,13 @@ public class ImageMessageReceiver {
|
||||
|
||||
@SneakyThrows
|
||||
@RabbitListener(queues = MessagingConfiguration.IMAGE_SERVICE_RESPONSE_QUEUE)
|
||||
public void receive(byte[] in) {
|
||||
public void receive(String in) {
|
||||
|
||||
JsonNode imageResponse = objectMapper.readTree(in);
|
||||
|
||||
String dossierId = imageResponse.path("dossierId").asText();
|
||||
String fileId = imageResponse.path("fileId").asText();
|
||||
|
||||
if (settings.isStoreImageFile()) {
|
||||
fileManagementStorageService.storeObject(dossierId, fileId, FileType.IMAGE_INFO, new ByteArrayInputStream(in));
|
||||
}
|
||||
fileStatusService.setStatusAnalyse(dossierId, fileId, false);
|
||||
|
||||
log.info("Received message from {} for dossierId {} and fileId {}", MessagingConfiguration.IMAGE_SERVICE_RESPONSE_QUEUE, dossierId, fileId);
|
||||
|
||||
@ -27,7 +27,7 @@ public class NerMessageReceiver {
|
||||
|
||||
@SneakyThrows
|
||||
@RabbitListener(queues = MessagingConfiguration.NER_SERVICE_RESPONSE_QUEUE)
|
||||
public void receive(byte[] in) {
|
||||
public void receive(String in) {
|
||||
|
||||
HashMap<String, Object> entityResponse = objectMapper.readValue(in, new TypeReference<>() {
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user