diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 176c50b9c..6bfe7dfbe 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ - [cygnus-ngsi][cygnus-common] Fix way to handle CygnusPersistenceException to allow batch retries in arcgis-sink if `.batch_ttl` configured +- [cygnus-ngsi][cygnus-common] Remove new line chars from Arcgis logs diff --git a/cygnus-common/pom.xml b/cygnus-common/pom.xml index 298da2926..f3fedea84 100644 --- a/cygnus-common/pom.xml +++ b/cygnus-common/pom.xml @@ -5,7 +5,7 @@ com.telefonica.iot cygnus-common - 3.15.0 + 3.15.0-SNAPSHOT jar cygnus-common diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java index 15e022d20..f5fbe5cd1 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/ArcgisFeatureTable.java @@ -89,11 +89,7 @@ protected ArcgisFeatureTable() { public ArcgisFeatureTable(String url, String user, String password, String tokenGenUrl, boolean readOnly, int connectionTimeout, int readTimeout) { this(); - LOGGER.debug("Arcgis constructor.. " + url); - - LOGGER.debug("Arcgis url.. " + url); - LOGGER.debug("Arcgis tokenGenUrl.. " + tokenGenUrl); - LOGGER.debug("Arcgis readOnly.. " + readOnly); + LOGGER.debug("ArcgisFeatureTable constructor. Url: " + url + " tokenGenUrl: " + tokenGenUrl + " readOnly: " + readOnly); Credential credential = new UserCredential(user, password); try { @@ -104,8 +100,8 @@ public ArcgisFeatureTable(String url, String user, String password, String token connected = true; } catch (ArcgisException e) { LOGGER.error("Arcgis error while connecting to Feature Table: (" + e.getMessage() + ")" - + "\n\t URL: " + url - + "\n\t tokenGenURL: " + tokenGenUrl); + + "\t URL: " + url + + "\t tokenGenURL: " + tokenGenUrl); connected = false; setError(e); this.errorDesc += " " + url + " - " + tokenGenUrl; diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/CredentialRestApi.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/CredentialRestApi.java index af2a646f9..3de37519f 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/CredentialRestApi.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/CredentialRestApi.java @@ -92,8 +92,8 @@ public CredentialRestApi(String tokenGenUrl, Credential credential, String refer * @throws ArcgisException */ public Credential getCredential() throws ArcgisException { - LOGGER.debug("------------------ getCredential() " + "\n\t tokenGenUrl: " + tokenGenUrl - + "\n\t credential: " + credential + "\n\t credential.isExpired(): " + LOGGER.debug("------------------ getCredential() " + "\t tokenGenUrl: " + tokenGenUrl + + "\t credential: " + credential + "\t credential.isExpired(): " + (credential != null ? credential.isExpired() : null)); if (tokenGenUrl != null && (credential == null || credential.isExpired())) { LOGGER.debug("Creating/Refreshing token."); diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestApi.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestApi.java index 86deac5be..ca8e4e6e1 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestApi.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestApi.java @@ -256,12 +256,12 @@ public boolean verify(String hostname, SSLSession session) { } catch (UnknownHostException e) { httpResponse.setResponseCode(HttpURLConnection.HTTP_NOT_FOUND); - httpResponse.setResponseMessage(e.getClass() + "\n" + e.getMessage()); + httpResponse.setResponseMessage(e.getClass() + " error message: " + e.getMessage()); } catch (IllegalArgumentException e) { httpResponse.setResponseMessage("Check url, it may have 'http:/' instead of 'http://' " - + e.getClass() + "\n" + e.getMessage()); + + e.getClass() + " error message: " + e.getMessage()); } catch (Exception e) { - httpResponse.setResponseMessage(e.getClass() + "\n" + e.getMessage()); + httpResponse.setResponseMessage(e.getClass() + " error message: " + e.getMessage()); } finally { LOGGER.debug("Disposing connection objects"); if (rd != null) { @@ -357,7 +357,7 @@ protected static void checkHttpResponse(String httpResponse) throws ArcgisExcept throw new ArcgisException("Unexpected response format" + httpResponse); } catch (IllegalStateException | ClassCastException e) { throw new ArcgisException("checkHttpResponse, Unexpected exception" + e.getMessage() - + " \n\t" + httpResponse); + + " httpResponse: " + httpResponse); } catch (NullPointerException e) { throw new ArcgisException( "checkHttpResponse, Null Body recived from server." + httpResponse); @@ -470,7 +470,7 @@ protected static void checkHttpSingleResponse(JsonObject node) throws ArcgisExce } throw new ArcgisException(errorCode, - "Response Error " + errorCode + " " + message + "\n" + details); + "Response ErrorCode: " + errorCode + " message: " + message + " details: " + details); } } diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestFeatureTable.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestFeatureTable.java index 2f630d80f..2a33c1fd8 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestFeatureTable.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/arcgis/restutils/RestFeatureTable.java @@ -221,7 +221,7 @@ public ResultPage getFeatureList(String whereClause, int pageOffset, St } HttpResponse response = httpGet(fullUrl, params, this.connectionTimeout, this.readTimeout); - LOGGER.debug("Response code: " + response.getResponseCode() + "\n\t" + response.getBody()); + LOGGER.debug("Response code: " + response.getResponseCode() + "\t response body: " + response.getBody()); checkResponse(response); @@ -238,7 +238,7 @@ public ResultPage getFeatureList(String whereClause, int pageOffset, St */ protected void checkResponse(HttpResponse response) throws ArcgisException { if (!checkHttpResponse(response)) { - String errorMsg = "Error: " + response.getErrorCode() + "\n" + String errorMsg = "Error code: " + response.getErrorCode() + " error message: " + response.getErrorMessage(); LOGGER.error(errorMsg); throw new ArcgisException(errorMsg); @@ -274,7 +274,7 @@ public void sendFeatureList(List featureList, String action) throws Arc } HttpResponse response = httpPost(fullUrl, params, bodyParams, this.connectionTimeout, this.readTimeout); - LOGGER.debug("Response code: " + response.getResponseCode() + "\n\t" + response.getBody()); + LOGGER.debug("Response code: " + response.getResponseCode() + "\t response body: " + response.getBody()); checkResponse(response); } @@ -359,7 +359,7 @@ public void deleteEntities(List objectIdList) throws ArcgisException { } HttpResponse response = httpPost(fullUrl, params, bodyParams, this.connectionTimeout, this.readTimeout); - LOGGER.debug("Response code: " + response.getResponseCode() + "\n\t" + response.getBody()); + LOGGER.debug("Response code: " + response.getResponseCode() + "\t response body: " + response.getBody()); checkResponse(response); @@ -406,7 +406,7 @@ public void getTableAttributesInfo() throws ArcgisException { LOGGER.debug("HttpGet " + fullUrl.toString() + " number of params: " + params.size()); HttpResponse response = httpGet(fullUrl, params, this.connectionTimeout, this.readTimeout); - LOGGER.debug("Response code: " + response.getResponseCode() + "\n\t" + response.getBody()); + LOGGER.debug("Response code: " + response.getResponseCode() + "\t response body: " + response.getBody()); checkResponse(response); @@ -421,8 +421,8 @@ public void getTableAttributesInfo() throws ArcgisException { } else { String errorMsg = "getTableAttributesInfo: Unexpected server response, Error: " - + response.getErrorCode() + "\n" + response.getErrorMessage(); - errorMsg += " \n\t token: " + token; + + response.getErrorCode() + " error message: " + response.getErrorMessage(); + errorMsg += " \t token: " + token; LOGGER.error(errorMsg); throw new ArcgisException(errorMsg); } diff --git a/cygnus-ngsi-ld/pom.xml b/cygnus-ngsi-ld/pom.xml index 41725da45..5dd2a3581 100644 --- a/cygnus-ngsi-ld/pom.xml +++ b/cygnus-ngsi-ld/pom.xml @@ -5,7 +5,7 @@ com.telefonica.iot cygnus-ngsi-ld - 3.15.0 + 3.15.0-SNAPSHOT jar cygnus-ngsi-ld @@ -60,7 +60,7 @@ com.telefonica.iot cygnus-common - 3.15.0 + 3.15.0-SNAPSHOT diff --git a/cygnus-ngsi/pom.xml b/cygnus-ngsi/pom.xml index c83d74a00..8ad5b1801 100644 --- a/cygnus-ngsi/pom.xml +++ b/cygnus-ngsi/pom.xml @@ -5,7 +5,7 @@ com.telefonica.iot cygnus-ngsi - 3.15.0 + 3.15.0-SNAPSHOT jar cygnus-ngsi @@ -63,7 +63,7 @@ com.telefonica.iot cygnus-common - 3.15.0 + 3.15.0-SNAPSHOT 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 cee6d251d..151c278d9 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 @@ -543,7 +543,7 @@ public void aggregate(NGSIEvent event) throws CygnusRuntimeError { throw new CygnusRuntimeError(e.getMessage()); } catch (Exception e) { LOGGER.error("[NGSIArcgisAggregator] aggregate - Unexpected Error" + e.getMessage() - + "\n contextElement: " + contextElement.toString()); + + " contextElement: " + contextElement.toString()); throw new CygnusRuntimeError(e.getMessage()); } diff --git a/cygnus-twitter/pom.xml b/cygnus-twitter/pom.xml index 06444f2c1..9c95937f3 100644 --- a/cygnus-twitter/pom.xml +++ b/cygnus-twitter/pom.xml @@ -5,7 +5,7 @@ com.telefonica.iot cygnus-twitter - 3.15.0 + 3.15.0-SNAPSHOT jar cygnus-twitter @@ -57,7 +57,7 @@ com.telefonica.iot cygnus-common - 3.15.0 + 3.15.0-SNAPSHOT diff --git a/docker/cygnus-common/Dockerfile b/docker/cygnus-common/Dockerfile index 9cb245ada..05ef3b75f 100644 --- a/docker/cygnus-common/Dockerfile +++ b/docker/cygnus-common/Dockerfile @@ -27,7 +27,7 @@ MAINTAINER Francisco Romero Bueno # Environment variables ENV CYGNUS_USER "cygnus" ENV CYGNUS_HOME "/opt/fiware-cygnus" -ENV CYGNUS_VERSION "3.15.0" +ENV CYGNUS_VERSION "3.15.0-SNAPSHOT" ENV CYGNUS_CONF_PATH "/opt/apache-flume/conf" ENV CYGNUS_CONF_FILE "/opt/apache-flume/conf/agent.conf" ENV CYGNUS_AGENT_NAME "cygnus-common" @@ -40,7 +40,7 @@ ENV CYGNUS_API_PORT "8081" # PR https://github.com/telefonicaid/fiware-cygnus/pull/1801 should be also done in this Dockerfile # NOTE: Configure correctly GIT_URL_CYGNUS and GIT_REV_CYGNUS for each git branch/fork used ENV GIT_URL_CYGNUS "https://github.com/telefonicaid/fiware-cygnus.git" -ENV GIT_REV_CYGNUS "release/3.15.0" +ENV GIT_REV_CYGNUS "master" ENV MVN_VER "3.5.4" ENV MVN_TGZ "apache-maven-${MVN_VER}-bin.tar.gz" diff --git a/docker/cygnus-ngsi-ld/Dockerfile b/docker/cygnus-ngsi-ld/Dockerfile index 6f61c035a..ef4c6dc78 100644 --- a/docker/cygnus-ngsi-ld/Dockerfile +++ b/docker/cygnus-ngsi-ld/Dockerfile @@ -27,7 +27,7 @@ ARG GITHUB_REPOSITORY=fiware-cygnus # Environment variables ENV CYGNUS_USER "cygnus" ENV CYGNUS_HOME "/opt/fiware-cygnus" -ENV CYGNUS_VERSION "3.15.0" +ENV CYGNUS_VERSION "3.15.0-SNAPSHOT" ENV CYGNUS_CONF_PATH "/opt/apache-flume/conf" ENV CYGNUS_CONF_FILE "/opt/apache-flume/conf/agent.conf" ENV CYGNUS_AGENT_NAME "cygnus-ngsi-ld" diff --git a/docker/cygnus-ngsi/Dockerfile b/docker/cygnus-ngsi/Dockerfile index b67ed9c48..0aa615b89 100644 --- a/docker/cygnus-ngsi/Dockerfile +++ b/docker/cygnus-ngsi/Dockerfile @@ -23,7 +23,7 @@ ARG GITHUB_REPOSITORY=fiware-cygnus # Environment variables ENV CYGNUS_USER "cygnus" ENV CYGNUS_HOME "/opt/fiware-cygnus" -ENV CYGNUS_VERSION "3.15.0" +ENV CYGNUS_VERSION "3.15.0-SNAPSHOT" ENV CYGNUS_CONF_PATH "/opt/apache-flume/conf" ENV CYGNUS_CONF_FILE "/opt/apache-flume/conf/agent.conf" ENV CYGNUS_AGENT_NAME "cygnus-ngsi" diff --git a/docker/cygnus-twitter/Dockerfile b/docker/cygnus-twitter/Dockerfile index 33e353b06..a9af877e4 100644 --- a/docker/cygnus-twitter/Dockerfile +++ b/docker/cygnus-twitter/Dockerfile @@ -27,7 +27,7 @@ MAINTAINER Javi Palanca # Environment variables ENV CYGNUS_USER "cygnus" ENV CYGNUS_HOME "/opt/fiware-cygnus" -ENV CYGNUS_VERSION "3.15.0" +ENV CYGNUS_VERSION "3.15.0-SNAPSHOT" ENV CYGNUS_CONF_PATH "/opt/apache-flume/conf" ENV CYGNUS_CONF_FILE "/opt/apache-flume/conf/agent.conf" ENV CYGNUS_AGENT_NAME "cygnus-twitter" @@ -39,7 +39,7 @@ ENV CYGNUS_JAVA_OPTS "-Xms2048m -Xmx4096m" # PR https://github.com/telefonicaid/fiware-cygnus/pull/1801 should be also done in this Dockerfile # NOTE: Configure correctly GIT_URL_CYGNUS and GIT_REV_CYGNUS for each git branch/fork used ENV GIT_URL_CYGNUS "https://github.com/telefonicaid/fiware-cygnus.git" -ENV GIT_REV_CYGNUS "release/3.15.0" +ENV GIT_REV_CYGNUS "master" ENV MVN_VER "3.5.4" ENV MVN_TGZ "apache-maven-${MVN_VER}-bin.tar.gz"