Commit 1092c965 authored by Nikhil Singh[MicroSoft]'s avatar Nikhil Singh[MicroSoft]
Browse files

Commit 13 Contents:

1-Short Topic name usage
2-NPE Handling
parent 64c3542b
Pipeline #54595 failed with stages
in 19 seconds
......@@ -24,7 +24,6 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.register.provider.azure.di.AzureBootstrapConfig;
import org.opengroup.osdu.register.provider.azure.di.CosmosContainerConfig;
import org.opengroup.osdu.register.provider.azure.util.CryptographyUtil;
import org.opengroup.osdu.register.provider.azure.util.PartitionHelperServiceBus;
import org.opengroup.osdu.register.subscriber.model.*;
import org.opengroup.osdu.register.utils.Constants;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -53,12 +52,6 @@ public class CosmosSubscription {
@Autowired
private CryptographyUtil cryptographyUtil;
@Autowired
private PartitionHelperServiceBus partitionHelper;
@Autowired
private TopicsRepositoryImpl topicsRepository;
public Subscription createSubscription(Subscription input) throws AppException {
SubscriptionDoc doc = new SubscriptionDoc(input, dpsHeaders.getPartitionId());
doc.setTopic(input.getTopic());
......
......@@ -58,12 +58,12 @@ public class ManagementClientFactoryImpl implements IManagementClientFactory {
ConnectionStringBuilder connectionStringBuilder = new ConnectionStringBuilder(serviceBusConnectionString);
ManagementClient managementClient = new ManagementClient(connectionStringBuilder);
if (managementClient == null)
throw new Exception("Null Pointer Exception");
throw new NullPointerException();
logger.debug("Management client creation successful for partition Id : " + dpsHeaders.getPartitionId());
this.clientCache.put(cacheKey, managementClient);
return managementClient;
} catch (Exception e) {
if (e.getMessage().equals("Null Pointer Exception")) {
if (e instanceof NullPointerException) {
logger.error("Management client can not be Null for partition Id : " + dpsHeaders.getPartitionId());
throw new AppException(500, "Null Pointer Exception", MANAGEMENT_CLIENT_ERROR_MESSAGE);
} else {
......
......@@ -17,7 +17,6 @@ package org.opengroup.osdu.register.provider.azure.subscriber.pubsub;
import com.microsoft.azure.servicebus.management.ManagementClient;
import com.microsoft.azure.servicebus.primitives.MessagingEntityAlreadyExistsException;
import com.microsoft.azure.servicebus.primitives.MessagingEntityNotFoundException;
import org.opengroup.osdu.azure.partition.PartitionServiceClient;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
......@@ -37,8 +36,6 @@ public class PullSubscription implements IPubsubSubscription {
private DpsHeaders dpsHeaders;
@Autowired
private JaxRsDpsLog logger;
@Autowired
private PartitionServiceClient partitionService;
public void createSubscription(String subscriptionId, String topicAliasName) {
ManagementClient managementClient = factory.getManager();
......
Markdown is supported
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