Skip to content
Snippets Groups Projects
Commit 198b1421 authored by Rostislav Dublin (EPAM)'s avatar Rostislav Dublin (EPAM)
Browse files

All done. All ITs pass on both PubSub and Mq

parent ac375cd2
No related branches found
No related tags found
1 merge request!144(GONRG-3831) GCP Notification: OQM mapper
Pipeline #79775 failed
......@@ -37,11 +37,6 @@
</properties>
<dependencies>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>osm</artifactId>
<version>0.13.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>oqm</artifactId>
......
......@@ -12,7 +12,6 @@ import org.opengroup.osdu.core.common.partition.Property;
import org.opengroup.osdu.core.gcp.oqm.driver.OqmDriverRuntimeException;
import org.opengroup.osdu.core.gcp.oqm.driver.rabbitmq.MqOqmDestinationResolution;
import org.opengroup.osdu.core.gcp.oqm.model.OqmDestination;
import org.opengroup.osdu.core.gcp.osm.translate.TranslatorRuntimeException;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
......@@ -62,8 +61,8 @@ public class MqTenantOqmDestinationResolver implements org.opengroup.osdu.core.g
private final IPartitionProvider partitionProvider;
private Map<String, ConnectionFactory> amqpConnectionFactoryCache = new HashMap<>();
private Map<String, Client> httpClientCache = new HashMap<>();
private final Map<String, ConnectionFactory> amqpConnectionFactoryCache = new HashMap<>();
private final Map<String, Client> httpClientCache = new HashMap<>();
@Override
public MqOqmDestinationResolution resolve(OqmDestination destination) {
......@@ -85,7 +84,7 @@ public class MqTenantOqmDestinationResolver implements org.opengroup.osdu.core.g
try {
partitionInfo = partitionProvider.get(partitionId);
} catch (PartitionException e) {
throw new TranslatorRuntimeException(e, "Partition '{}' destination resolution issue", destination.getPartitionId());
throw new OqmDriverRuntimeException(e, "Partition '{}' destination resolution issue", destination.getPartitionId());
}
Map<String, Property> partitionProperties = partitionInfo.getProperties();
......@@ -142,7 +141,7 @@ public class MqTenantOqmDestinationResolver implements org.opengroup.osdu.core.g
private String getPartitionProperty(String partitionId, Map<String, Property> partitionProperties, String propertyName) {
String fullName = properties.getPartitionPropertiesPrefix().concat(propertyName);
return Optional.ofNullable(partitionProperties.get(fullName)).map(Property::getValue).map(Object::toString)
.orElseThrow(() -> new TranslatorRuntimeException(null,
.orElseThrow(() -> new OqmDriverRuntimeException(null,
"Partition '{}' RabbitMQ OQM destination resolution configuration issue. Property '{}' is not provided in PartitionInfo.",
partitionId, fullName));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment