Skip to content

change currency rate events#62

Open
vitaxa wants to merge 3 commits intomasterfrom
ft/change-rate-listener
Open

change currency rate events#62
vitaxa wants to merge 3 commits intomasterfrom
ft/change-rate-listener

Conversation

@vitaxa
Copy link
Contributor

@vitaxa vitaxa commented Feb 25, 2026

  • change currency rate events
  • flywaydb clickhouse support

flywaydb clickhouse support
}

private String resolveClickHouseMigrationLocation(String schemaMode) {
return switch (schemaMode.toLowerCase(Locale.ROOT)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выше уже был toLowerCase оставил бы только выше


private String resolveClickHouseMigrationLocation(String schemaMode) {
return switch (schemaMode.toLowerCase(Locale.ROOT)) {
case "non-sharded" -> "classpath:db/migration-clickhouse/non-sharded";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай в константы

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и "non-sharded" и значение лучше вообще в переменную

Comment on lines +105 to +107
if ("non-sharded".equals(schemaMode)) {
return Map.of();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это можно просто удалить результат будет тот же

Comment on lines +110 to +117
validateRequiredShardedProperty("clickhouse.flyway.sharded.cluster", shardedCluster);
validateRequiredShardedProperty("clickhouse.flyway.sharded.shard", shardedShard);
validateRequiredShardedProperty("clickhouse.flyway.sharded.replica", shardedReplica);
return Map.of(
"cluster", shardedCluster,
"shard", shardedShard,
"replica", shardedReplica);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тоже бы константы какие то сделать и переменные

Comment on lines +18 to +26
if (!event.isSetPayload()) {
log.warn("CurrencyEvent payload not set, eventId={}", event.getEventId());
return null;
}
CurrencyEventPayload payload = event.getPayload();
if (!payload.isSetExchangeRate()) {
log.warn("CurrencyEvent payload is not exchange_rate, eventId={}", event.getEventId());
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

может в один объединить а то чет тянется и весь payload отлогировать

Comment on lines +44 to +57
if (sourceCurrency == null || !sourceCurrency.isSetSymbolicCode() || !sourceCurrency.isSetExponent()) {
log.warn("CurrencyEvent source currency incomplete, eventId={}", event.getEventId());
return null;
}
if (destinationCurrency == null
|| !destinationCurrency.isSetSymbolicCode()
|| !destinationCurrency.isSetExponent()) {
log.warn("CurrencyEvent destination currency incomplete, eventId={}", event.getEventId());
return null;
}
if (rational == null || !rational.isSetP() || !rational.isSetQ()) {
log.warn("CurrencyEvent exchange rate rational incomplete, eventId={}", event.getEventId());
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тоже хорошо схлопывается и просто понятные методы isSetCurrency например которые целое условие проверяет для каждого

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants