[KAFKA-328] SLF4J usage issues Created: 09/Sep/22  Updated: 28/Oct/23  Resolved: 13/Sep/22

Status: Closed
Project: Kafka Connector
Component/s: Sink
Affects Version/s: 1.3.0
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Andrey Pustovetov Assignee: Maxim Katcharov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I found the following logging issues:

  1. premature toString() invocation

    LOGGER.debug(record.toString());
    

  2. string concatenation

    LOGGER.debug("key: " + keyDoc.toString());
    

which may cause performance issues in high-load applications.

In particular, I encountered unnecessary pressure on GC due to the premature toString() invocation.



 Comments   
Comment by Maxim Katcharov [ 13/Sep/22 ]

Thank you for finding and fixing this.

Comment by Githook User [ 13/Sep/22 ]

Author:

{'name': 'Andrey Pustovetov', 'email': 'andrey.pustovetov@gmail.com', 'username': 'jchipmunk'}

Message: SLF4J usage issues (#117)

Premature toString() invocation and string concatenation may cause performance issues in high-load applications.

KAFKA-328
Branch: master
https://github.com/mongodb/mongo-kafka/commit/601dc0d24d938fcce578070d90e06b9ec1342a85

Comment by Andrey Pustovetov [ 12/Sep/22 ]

I have prepared PR with the appropriate changes: https://github.com/mongodb/mongo-kafka/pull/117

Generated at Thu Feb 08 09:06:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.