Remove spring-integration-gemfire module
Starting with Spring Data 2022.0.0 there is not going to be GemFire (Geode) support directly from Spring team A source code of the `spring-integration-gemfire` is moving to Spring Integration Extensions from where community may consider to pull it and support in their own manner
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021 the original author or authors.
|
||||
* Copyright 2021-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,7 +33,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.integration.IntegrationMessageHeaderAccessor;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
@@ -56,7 +55,6 @@ import org.springframework.util.FileCopyUtils;
|
||||
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 5.5
|
||||
*/
|
||||
@SpringJUnitConfig
|
||||
@@ -81,12 +79,6 @@ public class FileAggregatorTests {
|
||||
@Autowired
|
||||
PollableChannel resultChannel;
|
||||
|
||||
@Autowired
|
||||
MessageChannel input;
|
||||
|
||||
@Autowired
|
||||
PollableChannel output;
|
||||
|
||||
@BeforeAll
|
||||
static void setup() throws IOException {
|
||||
file = new File(tmpDir, "foo.txt");
|
||||
@@ -146,26 +138,8 @@ public class FileAggregatorTests {
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFileAggregatorXmlConfig() {
|
||||
this.input.send(new GenericMessage<>(file));
|
||||
|
||||
Message<?> receive = this.output.receive(10_000);
|
||||
assertThat(receive).isNotNull();
|
||||
assertThat(receive.getHeaders())
|
||||
.containsEntry(FileHeaders.FILENAME, "foo.txt")
|
||||
.containsEntry(FileHeaders.LINE_COUNT, 4L)
|
||||
.doesNotContainKeys("firstLine", IntegrationMessageHeaderAccessor.CORRELATION_ID);
|
||||
|
||||
assertThat(receive.getPayload())
|
||||
.isInstanceOf(List.class)
|
||||
.asList()
|
||||
.containsExactly("file header", "first line", "second line", "last line");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableIntegration
|
||||
@ImportResource("org/springframework/integration/file/aggregator/FileAggregatorTests.xml")
|
||||
public static class Config {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int-file="http://www.springframework.org/schema/integration/file"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:gfe="http://www.springframework.org/schema/geode"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/file https://www.springframework.org/schema/integration/file/spring-integration-file.xsd
|
||||
http://www.springframework.org/schema/geode https://www.springframework.org/schema/geode/spring-geode.xsd">
|
||||
|
||||
<gfe:cache />
|
||||
|
||||
<gfe:local-region id="region1"/>
|
||||
|
||||
<bean id="gemfireMessageStore" class="org.springframework.integration.gemfire.store.GemfireMessageStore">
|
||||
<constructor-arg ref="region1"/>
|
||||
</bean>
|
||||
|
||||
<int:chain input-channel="input" output-channel="output">
|
||||
<int-file:splitter markers="true"/>
|
||||
<int:aggregator message-store="gemfireMessageStore">
|
||||
<bean class="org.springframework.integration.file.aggregator.FileAggregator"/>
|
||||
</int:aggregator>
|
||||
</int:chain>
|
||||
|
||||
<int:channel id="output">
|
||||
<int:queue/>
|
||||
</int:channel>
|
||||
|
||||
</beans>
|
||||
@@ -27,7 +27,6 @@ import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.apache.geode.cache.CacheFactory;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
@@ -35,7 +34,6 @@ import org.mockito.Mockito;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.integration.gemfire.metadata.GemfireMetadataStore;
|
||||
import org.springframework.integration.jdbc.metadata.JdbcMetadataStore;
|
||||
import org.springframework.integration.metadata.ConcurrentMetadataStore;
|
||||
import org.springframework.integration.redis.RedisContainerTest;
|
||||
@@ -50,9 +48,7 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
|
||||
* @author Artem Bilan
|
||||
* @author Bojan Vukasovic
|
||||
* @author Artem Vozhdayenko
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
*/
|
||||
public class PersistentAcceptOnceFileListFilterExternalStoreTests implements RedisContainerTest {
|
||||
|
||||
@@ -80,11 +76,6 @@ public class PersistentAcceptOnceFileListFilterExternalStoreTests implements Red
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFileSystemWithGemfireMetadataStore() throws Exception {
|
||||
this.testFileSystem(new GemfireMetadataStore(new CacheFactory().create()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFileSystemWithJdbcMetadataStore() throws Exception {
|
||||
EmbeddedDatabase dataSource = new EmbeddedDatabaseBuilder()
|
||||
@@ -135,21 +126,21 @@ public class PersistentAcceptOnceFileListFilterExternalStoreTests implements Red
|
||||
final FileSystemPersistentAcceptOnceFileListFilter filter =
|
||||
new FileSystemPersistentAcceptOnceFileListFilter(store, "foo:");
|
||||
final File file = File.createTempFile("foo", ".txt");
|
||||
assertThat(filter.filterFiles(new File[] {file})).hasSize(1);
|
||||
assertThat(filter.filterFiles(new File[]{ file })).hasSize(1);
|
||||
String ts = store.get("foo:" + file.getAbsolutePath());
|
||||
assertThat(ts).isEqualTo(String.valueOf(file.lastModified()));
|
||||
assertThat(filter.filterFiles(new File[] {file})).isEmpty();
|
||||
assertThat(filter.filterFiles(new File[]{ file })).isEmpty();
|
||||
assertThat(file.setLastModified(file.lastModified() + 5000L)).isTrue();
|
||||
assertThat(filter.filterFiles(new File[] {file})).hasSize(1);
|
||||
assertThat(filter.filterFiles(new File[]{ file })).hasSize(1);
|
||||
ts = store.get("foo:" + file.getAbsolutePath());
|
||||
assertThat(ts).isEqualTo(String.valueOf(file.lastModified()));
|
||||
assertThat(filter.filterFiles(new File[] {file})).isEmpty();
|
||||
assertThat(filter.filterFiles(new File[]{ file })).isEmpty();
|
||||
|
||||
suspend.set(true);
|
||||
assertThat(file.setLastModified(file.lastModified() + 5000L)).isTrue();
|
||||
|
||||
Future<Integer> result = Executors.newSingleThreadExecutor()
|
||||
.submit(() -> filter.filterFiles(new File[] {file}).size());
|
||||
.submit(() -> filter.filterFiles(new File[]{ file }).size());
|
||||
assertThat(latch2.await(10, TimeUnit.SECONDS)).isTrue();
|
||||
store.put("foo:" + file.getAbsolutePath(), "43");
|
||||
latch1.countDown();
|
||||
|
||||
Reference in New Issue
Block a user