Skip to content

Commit

Permalink
Merge pull request #484 from groldan/GSBAB-151
Browse files Browse the repository at this point in the history
Implement eventual consistency enforcement for the datadir catalog backend
  • Loading branch information
groldan authored Jun 14, 2024
2 parents 90301ed + 7b388dd commit da6219e
Show file tree
Hide file tree
Showing 13 changed files with 1,319 additions and 27 deletions.
2 changes: 1 addition & 1 deletion compose/infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
resources:
limits:
cpus: '4.0'
memory: 1G
memory: 2G
restart: unless-stopped
healthcheck:
test: rabbitmq-diagnostics is_running
Expand Down
2 changes: 1 addition & 1 deletion config
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@
*/
package org.geoserver.cloud.autoconfigure.catalog.backend.datadir;

import org.geoserver.catalog.plugin.CatalogPlugin;
import org.geoserver.cloud.autoconfigure.catalog.event.ConditionalOnCatalogEvents;
import org.geoserver.cloud.event.remote.datadir.RemoteEventDataDirectoryProcessor;
import org.geoserver.config.plugin.RepositoryGeoServerFacade;
import org.springframework.beans.factory.annotation.Qualifier;
import org.geoserver.cloud.catalog.backend.datadir.EventualConsistencyEnforcer;
import org.geoserver.cloud.event.remote.datadir.RemoteEventDataDirectoryConfiguration;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

/**
* {@link AutoConfiguration @AutoConfiguration} to contribute beans related to handling remotely
* produced catalog and config events
*
* @see RemoteEventDataDirectoryConfiguration
*/
@AutoConfiguration
@ConditionalOnDataDirectoryEnabled
@ConditionalOnCatalogEvents
@Import(RemoteEventDataDirectoryConfiguration.class)
public class RemoteEventDataDirectoryAutoConfiguration {

@Bean
RemoteEventDataDirectoryProcessor dataDirectoryRemoteEventProcessor(
@Qualifier("geoserverFacade") RepositoryGeoServerFacade configFacade,
@Qualifier("rawCatalog") CatalogPlugin rawCatalog) {
return new RemoteEventDataDirectoryProcessor(configFacade, rawCatalog);
@ConditionalOnProperty(
name = "geoserver.backend.data-directory.eventual-consistency.enabled",
havingValue = "true",
matchIfMissing = true)
EventualConsistencyEnforcer eventualConsistencyEnforcer() {
return new EventualConsistencyEnforcer();
}
}
Loading

0 comments on commit da6219e

Please sign in to comment.