Skip to content

Commit

Permalink
fix: decrease log intensity
Browse files Browse the repository at this point in the history
  • Loading branch information
YusufMavzer committed Dec 19, 2023
1 parent a39391c commit cbcdf58
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,16 @@ The configuration file, `appsettings.json`, must be provided through a `volume m
Execute the `30_run-container.sh` script or use the standard Docker run command. The script includes the `--rm` flag to automatically remove the container upon completion.

```sh

# Linux/ MacOs
$ ./30_run-container.sh ./src/kafka.transfer.app/appsettings.linux.json
#OR
$ docker run -it --rm -v "${APPSETTINGS_PATH}:/app/appsettings.json" ghcr.io/informatievlaanderen/kafka-topic-transfer:0.0.1

# Windows
$ ./30_run-container.sh "C:\APPSETTINGS_PATH\appsettings.MACHINENAME.json"


# OR
$ docker run -it --rm -v "ABSOLUTE_APPSETTINGS_PATH:/app/appsettings.json" ghcr.io/informatievlaanderen/kafka-topic-transfer:0.0.2
```

## Running with Docker-Compose
Expand All @@ -81,7 +88,7 @@ networks:

services:
basisregisters.kafka-topic-transfer:
image: ghcr.io/informatievlaanderen/kafka-topic-transfer:0.0.1
image: ghcr.io/informatievlaanderen/kafka-topic-transfer:0.0.2
container_name: basisregisters.kafka-topic-transfer
volumes:
- "/home/yusuf/repos/fork/kafka-transfer/src/kafka.transfer.app/appsettings.linux.json:/app/appsettings.json"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.0.2
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ networks:

services:
basisregisters.kafka-topic-transfer:
image: ghcr.io/informatievlaanderen/kafka-topic-transfer:0.0.1
image: ghcr.io/informatievlaanderen/kafka-topic-transfer:0.0.2
container_name: basisregisters.kafka-topic-transfer
volumes:
- "/home/yusuf/repos/fork/kafka-transfer/src/kafka.transfer.app/appsettings.linux.json:/app/appsettings.json"
Expand Down
9 changes: 6 additions & 3 deletions src/kafka.transfer.app/DataTarget/DataTargetBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ public async Task Start()
var rawMessage = block.RawMessage as ConsumeResult<string, string>;

//Observer sent ->
_logger.LogInformation("Publishing consumed message with offset {Offset}", rawMessage!.TopicPartitionOffset.Offset);

var offset = rawMessage!.TopicPartitionOffset.Offset.Value;
var logLevel = offset % 1000L == 0 ? LogLevel.Information : LogLevel.Debug;
_logger.Log(logLevel, $"Publishing consumed message with offset {offset}");

await _target.Publish(rawMessage, _cancellationToken.Token);
_offsetManager.OnNext(block.RawMessage);

//No more messages in the queue
if (_bufferBlock.Count == 0)
{
_logger.LogInformation("All messages in TPL queue are consumed and published");
_logger.LogInformation("All messages in TPL queue are consumed and published. \nWaiting for messages from consumer.");
_logger.LogInformation($"Current offset: {offset}");
}
}
}
Expand Down

0 comments on commit cbcdf58

Please sign in to comment.