-
Notifications
You must be signed in to change notification settings - Fork 0
Реализация сервиса Analyzer #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
kesch9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отличная работа
| max.poll.interval.ms: 30000 | ||
| producer: | ||
| value-serializer: ru.yandex.practicum.kafka.telemetry.serializer.SensorSnapshotAvroSerializer | ||
| value-serializer: ru.yandex.practicum.kafka.telemetry.serializer.SensorSnapshotSerializer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В интерфейсе SnapshotService лишний public у метода, он избыточен
| case DeviceRemovedEventAvro removed -> { | ||
| sensorRepository.deleteById(removed.getId()); | ||
| } | ||
| case ScenarioAddedEventAvro added -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Переменную added лучше переименовать, она совпадает с первым case
| case DeviceAddedEventAvro added -> { | ||
| sensorRepository.save(eventMapper.toSensorEntity(event.getHubId(), added)); | ||
| } | ||
| case DeviceRemovedEventAvro removed -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно написать в компактном виде, на мой взгляд лучше выглядит
case DeviceAddedEventAvro added -> sensorRepository.save(eventMapper.toSensorEntity(event.getHubId(), added));
case DeviceRemovedEventAvro removed -> sensorRepository.deleteById(removed.getId());
Добавлен сервис
Analyzer, замыкающий цикл обработки данных.HubEventиSensorsSnapshotиз Kafka.Hub Routerчерез gRPC.