diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index c1f10d9ee..3b99cda05 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,3 @@ [cygnus-common] Upgrade postgresql from 42.4.3 to 42.7.2 [cygnus-common] [arcgis] Fix: check feature attributes containsKey before get it (#2347) +[cygnus-ngsi] [arcgis-sink] Set always uniqueField from aggregator for all features (#2349) diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java index b4b8e5d29..0b7944d57 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java @@ -385,12 +385,10 @@ public void persistAggregation(NGSIArcgisAggregator aggregator) throws CygnusRun + " is new: " + isNewFeatureTable); ArcgisFeatureTable featureTable = getPersistenceBackend(featureTableUrl); - // If it's a new one, sets uniqueField value - if (isNewFeatureTable) { - LOGGER.debug("[" + this.getName() + "] Created new backend for " + featureTableUrl - + " with uniqueField: " + aggregation.getUniqueField()); - featureTable.setUniqueField(aggregation.getUniqueField()); - } + // Sets always uniqueField value + LOGGER.debug("[" + this.getName() + "] Backend for " + featureTableUrl + + " with uniqueField: " + aggregation.getUniqueField()); + featureTable.setUniqueField(aggregation.getUniqueField()); featureTable.addToBatch(aggregation.getFeature()); if (featureTable.hasError()){ @@ -514,6 +512,7 @@ public void aggregate(NGSIEvent event) throws CygnusRuntimeError { String entityType = contextElement.getType(); // Set unique filed and it's value. + LOGGER.debug("[NGSIArcgisAggregator] aggregate - uniqueField ->" + entityType); aggregation.setUniqueField(entityType); feature.addAttribute(entityType, entityId);