You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/09/01 07:12:00 UTC

[jira] [Commented] (CAMEL-16895) Log masking results in stackoverflow for large inputs

    [ https://issues.apache.org/jira/browse/CAMEL-16895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17407898#comment-17407898 ] 

Claus Ibsen commented on CAMEL-16895:
-------------------------------------

Is that the original json that fails for you? Or did you change something as I can parse/mask it on my system.

> Log masking results in stackoverflow for large inputs
> -----------------------------------------------------
>
>                 Key: CAMEL-16895
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16895
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 3.11.0
>            Reporter: Julius Krah
>            Priority: Minor
>             Fix For: 3.12.0
>
>
> When a fairly large input string is submitted for logging and masking is enabled, this results in a StackoverflowError
>  
> Using camel with Spring Boot
> pom.xml
> {noformat}
>  <dependencyManagement>
>          <dependencies>
>              <dependency>
>                  <groupId>org.apache.camel.springboot</groupId>
>                  <artifactId>camel-spring-boot-bom</artifactId>
>                  <version>3.11.1</version>
>                  <type>pom</type>
>                  <scope>import</scope>
>              </dependency>
>          </dependencies>
>  </dependencyManagement>
>   <!-- ... -->
>  <dependency>
>              <groupId>org.springframework.boot</groupId>
>              <artifactId>spring-boot-starter-validation</artifactId>
>  </dependency>
>  <dependency>
>              <groupId>org.apache.camel.springboot</groupId>
>              <artifactId>camel-spring-boot-starter</artifactId>
>   </dependency>
> {noformat}
> Route.java
> {noformat}
>  @Component
>  public class Route extends RouteBuilder {  
>      @Override
>      public void configure() throws Exception {
>          from("rabbitmq:{{core.consumer.rabbitmq.exchange}}" +
>              "?exchangeType={{core.consumer.rabbitmq.exchange-type}}" +
>              "&queue={{core.consumer.rabbitmq.queue}}" +
>              "&routingKey={{core.consumer.rabbitmq.routing-key}}")
>              .routeId("queue route")
>              .log("Received payload from rabbitMQ: ${body}")
>              .unmarshal(new JacksonDataFormat(Dto.class))
>              .process(aProcessor)
>              .log("Data received ${body}")
>              .to("bean:requestProcessor?method=handleAckRequest").id("handle-ack-request")
>   
>              .to("direct:anotherRoute")
>          .end();
>      }
>  }
> {noformat}
> In the application.properties
>  *camel.springboot.log-mask=true*
>   
>  Now if I should post the following JSON payload through RabbitMQ
>   
> {noformat}
>  {
>      "qwjabrlanfssaPaymentID": 93974430,
>      "apiPortNumber": 0,
>      "pollerFrequency": 0,
>      "serviceCode": "QWERETEMKLJLANDD",
>      "extraData": {
>          "97280991": {
>              "pushToOriginator": true,
>              "uidID": 41189716,
>              "metaData": [
>              {                     
>                       "Value": 1070,   
>                       "Name": "Amount"                
>               },
>               {                    
>                        "Value": "PHP82TK6MY",                     
>                        "Name": "MpesaQwasdrtjknsNumber"                
>               },
>               {                    
>                       "Name": "Balance"                 
>               },
>               {                
>                      "Value": 20210825224512, 
>                      "Name": "TransactionDate" 
>               },
>               {                     
>                      "Value": 599726145860,
>                     "Name": "PhoneNumber"
>               }],
>              "pokjytsAmountCharged": 1070,
>              "hardwareRequestId": null,
>              "ProductCode": "UJHANSNLWII",
>              "isTillNumber": true,
>              "uniqueID": "83859103",
>              "vouchercode": " ",
>              "paybillNumber": "431553"
>          }
>      },
>      "oiusdftrPaymentStatus": 139,
>      "serviceUrl": "",
>      "lkjmnbsdcvfdertCurrencyCode": "YUM",
>      "wrapperUrl": "",
>      "wsdlFile": "",
>      "protocol": "default",
>      "sslEnabled": 0,
>      "numberOfSends": 0,
>      "invoiceNumber": "",
>      "erdfghytIsdgftgDate": "2021-08-25 22:45:20",
>      "lkjditgfJhsgruaCustomerName": "Customer",
>      "apiUserName": "",
>      "ojudhfgKaswsxsUUID": "1102967588",
>      "iuytredfHsdededAccountNumber": "4622785548",
>      "tyghfderrMode": [
>          "TUND_PUDF"
>      ],
>      "zxcvfgtrNsdfdfdMSISDN": "254726173860",
>      "apiFunctionName": "",
>      "kjhxcTransactionID": [
>          "PHP82TK6MY"
>      ],
>      "apiPassword": "xxxxx",
>      "kjhcvbnUUID": "1102967588",
>      "dfcxvbnClientCode": [
>          "SAFKE"
>      ],
>      "sslCertificatePath": "",
>      "isTokenService": 0,
>      "wsazxcvgbgthyujAmount": 1070,
>      "plsjdhfhPusherProcessorClass": "",
>      "requestOriginIDs": [
>          "21"
>      ],
>      "firstSend": "",
>      "maxNumberOfSends": 0,
>      "narration": "The service request is processed successfully.",
>      "hubCreationDate": "2021-08-25 22:45:20",
>      "allowsPolling": 1,
>      "serviceID": 3004,
>      "lastSend": "2021-08-25 19:45:20",
>      "nextSend": "2021-08-25 22:45:20",
>      "autoAcknowledgejfhtysidj": 0
>  }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)