Commit f4b90818 authored by harshit aggarwal's avatar harshit aggarwal
Browse files

undo stray changes

parent 6deb8f96
Pipeline #21842 failed with stages
in 2 minutes and 14 seconds
......@@ -22,7 +22,6 @@ public class MessageHandler implements IMessageHandler {
@Override
public CompletableFuture<Void> onMessageAsync(IMessage message) {
LOGGER.info("Pulled a Service Bus message");
this.processWKSTransform.initiateWksTransformation(message);
return this.receiveClient.completeAsync(message.getLockToken());
}
......
......@@ -82,6 +82,8 @@ public class WKSServiceImpl implements WKSService {
if(rawRecordsDetailsForTransformation.length > 0) {
Map<String, List<MappingsModel>> mappingsMap = retrieveMappingsMap(rawRecordsDetailsForTransformation);
// Updating mappings with latest minor and patch versions
updateMappingsWithLatestMinorAndPatchVersions(mappingsMap);
transformRecords(rawRecordsDetailsForTransformation, mappingsMap, dataPartitionId, correlationId);
}
} finally {
......@@ -124,11 +126,10 @@ public class WKSServiceImpl implements WKSService {
for (RawRecordDetails rawRecord : rawRecordsDetails) {
try {
List<MappingsModel> mappingsList = retrieveMappings(mappingsMap, rawRecord);
List<MappingsModel> mappingsWithLatestMinorAndPatchVersions = updateMappingsWithLatestMinorAndPatchVersions(mappingsList);
Tree rawRecordTree = retrieveRawRecordTree(rawRecord);
for (MappingsModel mappings: mappingsWithLatestMinorAndPatchVersions) {
for (MappingsModel mappings: mappingsList) {
try {
TransformRequest transformRequest = new TransformRequest(rawRecordTree, mappings);
......@@ -165,14 +166,18 @@ public class WKSServiceImpl implements WKSService {
LOGGER.info(Constants.TRANFORMATION_PROCESS_COMPLETED);
}
private List<MappingsModel> updateMappingsWithLatestMinorAndPatchVersions(List<MappingsModel> mappingsList) throws ApplicationException {
for (MappingsModel mappingsModel : mappingsList) {
private void updateMappingsWithLatestMinorAndPatchVersions(Map<String, List<MappingsModel>> mappingsMap) throws ApplicationException {
List<String> schemaKindsWithLatestMinorAndPatchVersions = schemaService.getSchemas(mappingsModel.getTargetSchemaKind());
mappingsModel.setTargetSchemaKind(schemaKindsWithLatestMinorAndPatchVersions.get(0));
for (Map.Entry<String, List<MappingsModel>> entry : mappingsMap.entrySet()) {
List<MappingsModel> mappingsModelList = new ArrayList<>();
for (MappingsModel mappingsModel : entry.getValue()) {
List<String> schemaKindsWithLatestMinorAndPatchVersions = schemaService.getSchemas(mappingsModel.getTargetSchemaKind());
mappingsModel.setTargetSchemaKind(schemaKindsWithLatestMinorAndPatchVersions.get(0));
mappingsModelList.add(mappingsModel);
}
entry.setValue(mappingsModelList);
}
LOGGER.info("Schemas for WKS fetched with latest minor and patch versions");
return mappingsList;
}
private void initializeMessageContext(String dataPartitionId, String correlationId) {
......
......@@ -50,10 +50,6 @@ public class RestClient {
*/
public RestResponse processRequest(RequestParameters requestParameters) {
LOGGER.info("Printing rest client parameters");
LOGGER.info(requestParameters.getCorrelationId());
LOGGER.info(requestParameters.getUrl());
HttpHeaders headers = setHeaders(requestParameters.getContent(), requestParameters.getAuthKey(),
requestParameters.getDataPartitionId(), requestParameters.getCorrelationId(),
requestParameters.getOnBehalfOf(), requestParameters.getAppKey());
......@@ -108,7 +104,6 @@ public class RestClient {
if (appKey != null) {
headers.set(Constants.APP_KEY, appKey);
}
LOGGER.info(String.valueOf(headers.get(Constants.CORRELATION_ID)));
return headers;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment