Skip to content

Commit

Permalink
get service and subservice from event using enableNamemapping flag
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Jun 11, 2024
1 parent 5907e65 commit e13fc7b
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,21 +482,9 @@ public void aggregate(NGSIEvent event) throws CygnusRuntimeError {

LOGGER.debug("[NGSIArcgisAggregator] aggregate - Selected context ->" + contextElement);

// get the getRecvTimeTs headers
Map<String, String> headers = event.getHeaders();

for (Entry<String, String> entry : headers.entrySet()) {
LOGGER.debug("Header entry key --> " + entry.getKey().toString() + ", value --> "
+ entry.getValue().toString());
if (entry.getKey() != null
&& NGSIConstants.FLUME_HEADER_MAPPED_SERVICE.equals(entry.getKey().toString())) {
service = entry.getValue().toString();
} else if (entry.getKey() != null
&& NGSIConstants.FLUME_HEADER_MAPPED_SERVICE_PATH.equals(entry.getKey().toString())) {
subService = entry.getValue().toString();
}
} // for

service = event.getServiceForNaming(enableNameMappings);
subService = event.getServicePathForNaming(enableNameMappings);

// Compose full url
featureTableUrl = argisServiceUrl + "/" + service + "/" + subService;
featureTableUrl = featureTableUrl.replaceAll("([^:])\\/\\/", "$1/");
Expand Down

0 comments on commit e13fc7b

Please sign in to comment.