Skip to content

Commit

Permalink
Updated log4j libraries, and extensionList err code, added status end…
Browse files Browse the repository at this point in the history
…point
  • Loading branch information
Yordan Stoykov committed Jan 20, 2022
1 parent f162a90 commit 856ba75
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion core-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<artifactId>cbs-adapters-exception-handling</artifactId>
<version>1.1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/core-connectors-camel-common-1.1.0-SNAPSHOT.jar</systemPath>
<systemPath>${basedir}/lib/core-connectors-camel-common-1.1.1-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.json</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public void process(Exchange exchange) throws Exception {
errorMessage = errorResponse.getString("description");
reasonText = "{ \"statusCode\": \"" + statusCode + "\"," +
"\"message\": \"" + errorMessage + "\"," +
"\"localeMessage\": \"" + errorMessageLocale + "\"," +
"\"detailedDescription\": \"" + detailedDescription + "\"" +
"\"localeMessage\": \"" + errorMessageLocale + "\"" + // + "\"," +
// "\"detailedDescription\": \"" + detailedDescription + "\"" +
"} ";
}
}
Expand All @@ -104,7 +104,7 @@ public void process(Exchange exchange) throws Exception {
"Processing the exception at CustomErrorProcessor", null, null,
exception.getMessage());
}
System.out.println("Reason Text: " + reasonText);
System.out.println("Erro reason text: " + reasonText);
exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, httpResponseCode);
exchange.getMessage().setHeader(Exchange.CONTENT_TYPE, "application/json");
exchange.getMessage().setBody(reasonText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class SendMoneyRouter extends RouteBuilder {
.register();

private final RouteExceptionHandlingConfigurer exceptionHandlingConfigurer = new RouteExceptionHandlingConfigurer();
private final CorsFilter corsFilter = new CorsFilter();
// private final CorsFilter corsFilter = new CorsFilter();

public void configure() {
// Add our global exception handling strategy
Expand Down Expand Up @@ -139,7 +139,7 @@ public void configure() {
"'Tracking the response', 'Verify the response', null)")

// Add CORS headers
.process(corsFilter)
// .process(corsFilter)

.process(exchange -> {
((Histogram.Timer) exchange.getProperty(TIMER_NAME_PUT)).observeDuration(); // stop Prometheus Histogram metric
Expand All @@ -156,7 +156,7 @@ public void configure() {

// Conditional whether errorMessage was found
.choice()
.when(simple("${body.get('statusCode')} == '3241'"))
.when(simple("${body.get('statusCode')} == '3242'"))
.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(409))
.end()
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void configure() {
.setHeader(Exchange.HTTP_METHOD, constant("GET"))

.to("bean:customJsonMessage?method=logJsonMessage('info', ${header.X-CorrelationId}, " +
"'Calling Hub API, get transfers, GET {{dfsp.host}}', " +
"'Calling Hub API, get transfers, GET {{ml-conn.outbound.host}}', " +
"'Tracking the request', 'Track the response', 'Input Payload: ${body}')")
.toD("{{ml-conn.outbound.host}}/transfers/${header.transferId}?bridgeEndpoint=true&throwExceptionOnFailure=false")
.unmarshal().json()
Expand Down
2 changes: 1 addition & 1 deletion core-connector/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Configuration status="WARN" packages="com.modusbox.log4j2.layout">
<Appenders>
<Console name="JsonConsole">
<CustomJsonLayout applicationName="ayapay-core-connector"/>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@


<!-- logging -->
<!-- vulnerability in log4j found, need to use only version 2.15.0 or above!!! -->
<!-- vulnerability in log4j found, need to use only version 2.17.0 or above!!! -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down

0 comments on commit 856ba75

Please sign in to comment.