diff --git a/devops/azure/chart/helm-config.yaml b/devops/azure/chart/helm-config.yaml index 89157496f323e000d9c149870ed0b7cc70c1fa05..d2c8d58c42609f7c97025822e66c6610759cbe33 100644 --- a/devops/azure/chart/helm-config.yaml +++ b/devops/azure/chart/helm-config.yaml @@ -14,3 +14,5 @@ image: repository: #{container-registry}#.azurecr.io branch: #{ENVIRONMENT_NAME}# tag: #{Build.SourceVersion}# + +istioDnsHost: #{ISTIO_DNS_HOST}# \ No newline at end of file diff --git a/devops/azure/chart/templates/virtual-service.yaml b/devops/azure/chart/templates/virtual-service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8d3a2cc1b23edee0a353b22fa8e6d8d3f09e53bb --- /dev/null +++ b/devops/azure/chart/templates/virtual-service.yaml @@ -0,0 +1,37 @@ +--- +# Source: /devops/azure/chart/templates/virtual-service.yaml +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: {{ .Chart.Name }} + namespace: osdu +spec: + hosts: + - "{{ .Values.istioDnsHost }}" + gateways: + - istio-gateway + http: + - match: + - uri: + prefix: "/api/indexer/v2" + route: + - destination: + host: {{ .Chart.Name }} + port: + number: 80 + corsPolicy: + maxAge: "60m" + allowCredentials: true + allowHeaders: + - Authorization + - Data-Partition-Id + - Correlation-Id + - Content-Type + allowMethods: + - POST + - GET + - PUT + - PATCH + - DELETE + allowOrigins: + - prefix: "*" \ No newline at end of file diff --git a/devops/azure/chart/values.yaml b/devops/azure/chart/values.yaml index 7ad7ec09d9d78519cf118719ce60207873234536..dc84d481047a2dfec6747ae517b86a32c9d6534f 100644 --- a/devops/azure/chart/values.yaml +++ b/devops/azure/chart/values.yaml @@ -21,3 +21,5 @@ image: repository: community.opengroup.org:5555/osdu/platform/system/indexer-service branch: master tag: latest + +istioDnsHost: "" \ No newline at end of file diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java index 947e060ba6171c9b96f0f47fe871e60f1d061e6d..914fba0a1ed1466be681f6be47e0f600a86e251f 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java @@ -46,7 +46,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - @Log @Component @RequestScope @@ -69,6 +68,10 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder { @Inject private StorageService storageService; + @Override + public void createWorkerTask(String payload, DpsHeaders headers) { + createTask(payload, headers); + } @Override public void createWorkerTask(String payload, Long countdownMillis, DpsHeaders headers) { @@ -76,6 +79,12 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder { createTask(payload, headers); } + @Override + public void createReIndexTask(String payload, DpsHeaders headers) { + headers.addCorrelationIdIfMissing(); + publishAllRecordsToServiceBus(payload, headers); + } + @Override public void createReIndexTask(String payload, Long countdownMillis, DpsHeaders headers) { headers.addCorrelationIdIfMissing(); @@ -151,7 +160,7 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder { message.setContentType("application/json"); try { - logger.debug("Indexer publishes message to Service Bus " + headers.getCorrelationId()); + logger.info("Indexer publishes message to Service Bus " + headers.getCorrelationId()); topicClientFactory.getClient(headers.getPartitionId(), serviceBusReindexTopicName).send(message); } catch (Exception e) { logger.error(e.getMessage(), e);