-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into SKYEDEN-3020-ConsumerRetransmissionImprove…
…ments
- Loading branch information
Showing
34 changed files
with
1,222 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ent/config/SubscriptionConfiguration.java → ...bscription/SubscriptionConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../config/SubscriptionHealthProperties.java → ...ription/SubscriptionHealthProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...gement/config/SubscriptionProperties.java → .../subscription/SubscriptionProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../tech/hermes/management/config/subscription/consumergroup/ConsumerGroupCleanUpConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package pl.allegro.tech.hermes.management.config.subscription.consumergroup; | ||
|
||
import java.time.Clock; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import pl.allegro.tech.hermes.management.domain.subscription.SubscriptionService; | ||
import pl.allegro.tech.hermes.management.domain.subscription.consumergroup.ConsumerGroupCleanUpScheduler; | ||
import pl.allegro.tech.hermes.management.domain.subscription.consumergroup.ConsumerGroupToDeleteRepository; | ||
import pl.allegro.tech.hermes.management.infrastructure.kafka.MultiDCAwareService; | ||
import pl.allegro.tech.hermes.management.infrastructure.leader.ManagementLeadership; | ||
import pl.allegro.tech.hermes.management.infrastructure.zookeeper.ZookeeperRepositoryManager; | ||
|
||
@Configuration | ||
@EnableConfigurationProperties(ConsumerGroupCleanUpProperties.class) | ||
public class ConsumerGroupCleanUpConfig { | ||
|
||
@Autowired ZookeeperRepositoryManager zookeeperRepositoryManager; | ||
|
||
@Bean | ||
ConsumerGroupCleanUpScheduler consumerGroupCleanUpScheduler( | ||
MultiDCAwareService multiDCAwareService, | ||
SubscriptionService subscriptionService, | ||
ConsumerGroupCleanUpProperties properties, | ||
ManagementLeadership managementLeadership, | ||
Clock clock) { | ||
return new ConsumerGroupCleanUpScheduler( | ||
multiDCAwareService, | ||
zookeeperRepositoryManager.getRepositoriesByType(ConsumerGroupToDeleteRepository.class), | ||
subscriptionService, | ||
properties, | ||
managementLeadership, | ||
clock); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...h/hermes/management/config/subscription/consumergroup/ConsumerGroupCleanUpProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package pl.allegro.tech.hermes.management.config.subscription.consumergroup; | ||
|
||
import java.time.Duration; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties(prefix = "consumer-group.clean-up") | ||
public class ConsumerGroupCleanUpProperties { | ||
private boolean enabled = true; | ||
private Duration interval = Duration.ofMinutes(5); | ||
private Duration initialDelay = Duration.ofMinutes(1); | ||
private Duration timeout = Duration.ofHours(24); | ||
private boolean removeTasksAfterTimeout = true; | ||
|
||
public boolean isEnabled() { | ||
return enabled; | ||
} | ||
|
||
public void setEnabled(boolean enabled) { | ||
this.enabled = enabled; | ||
} | ||
|
||
public Duration getInterval() { | ||
return interval; | ||
} | ||
|
||
public void setInterval(Duration interval) { | ||
this.interval = interval; | ||
} | ||
|
||
public Duration getInitialDelay() { | ||
return initialDelay; | ||
} | ||
|
||
public void setInitialDelay(Duration initialDelay) { | ||
this.initialDelay = initialDelay; | ||
} | ||
|
||
public Duration getTimeout() { | ||
return timeout; | ||
} | ||
|
||
public void setTimeout(Duration timeout) { | ||
this.timeout = timeout; | ||
} | ||
|
||
public void setRemoveTasksAfterTimeout(boolean removeTasksAfterTimeout) { | ||
this.removeTasksAfterTimeout = removeTasksAfterTimeout; | ||
} | ||
|
||
public boolean isRemoveTasksAfterTimeout() { | ||
return removeTasksAfterTimeout; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...ent/domain/subscription/consumergroup/ConsumerGroupAlreadyScheduledToDeleteException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package pl.allegro.tech.hermes.management.domain.subscription.consumergroup; | ||
|
||
import static java.lang.String.format; | ||
|
||
public class ConsumerGroupAlreadyScheduledToDeleteException extends RuntimeException { | ||
|
||
public ConsumerGroupAlreadyScheduledToDeleteException( | ||
ConsumerGroupToDelete consumerGroupToDelete, Throwable e) { | ||
super( | ||
format( | ||
"Consumer group already scheduled to delete, for subscription %s ", | ||
consumerGroupToDelete.subscriptionName().getQualifiedName()), | ||
e); | ||
} | ||
} |
Oops, something went wrong.