-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-8760 Postgres: using
DELETE ... RETURNING
Fixes #8760 * Make `PostgresChannelMessageStoreQueryProvider` to use single `DELETE ... RETURNING` for polling statements * Add `isUsingSingleStatementForPoll` and use it from `JdbcChannelMessageStore` * Execute Postgres init scripts to `PostgresContainerTest` * Code clean up * Document the new feature
- Loading branch information
1 parent
29186e2
commit 87a2ac5
Showing
9 changed files
with
156 additions
and
43 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
20 changes: 10 additions & 10 deletions
20
...n-jdbc/src/main/resources/org/springframework/integration/jdbc/schema-drop-postgresql.sql
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
-- Autogenerated: do not edit this file | ||
|
||
DROP INDEX INT_MESSAGE_IX1 ; | ||
DROP INDEX INT_CHANNEL_MSG_DATE_IDX ; | ||
DROP INDEX INT_CHANNEL_MSG_PRIORITY_IDX ; | ||
DROP TABLE INT_MESSAGE ; | ||
DROP TABLE INT_MESSAGE_GROUP ; | ||
DROP TABLE INT_GROUP_TO_MESSAGE ; | ||
DROP TABLE INT_LOCK ; | ||
DROP TABLE INT_CHANNEL_MESSAGE ; | ||
DROP TABLE INT_METADATA_STORE ; | ||
DROP SEQUENCE INT_MESSAGE_SEQ ; | ||
DROP INDEX IF EXISTS INT_MESSAGE_IX1 ; | ||
DROP INDEX IF EXISTS INT_CHANNEL_MSG_DATE_IDX ; | ||
DROP INDEX IF EXISTS INT_CHANNEL_MSG_PRIORITY_IDX ; | ||
DROP TABLE IF EXISTS INT_MESSAGE ; | ||
DROP TABLE IF EXISTS INT_MESSAGE_GROUP ; | ||
DROP TABLE IF EXISTS INT_GROUP_TO_MESSAGE ; | ||
DROP TABLE IF EXISTS INT_LOCK ; | ||
DROP TABLE IF EXISTS INT_CHANNEL_MESSAGE ; | ||
DROP TABLE IF EXISTS INT_METADATA_STORE ; | ||
DROP SEQUENCE IF EXISTS INT_MESSAGE_SEQ ; |
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
64 changes: 64 additions & 0 deletions
64
.../springframework/integration/jdbc/store/channel/PostgresJdbcChannelMessageStoreTests.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,64 @@ | ||
/* | ||
* Copyright 2023 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. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.integration.jdbc.store.channel; | ||
|
||
import javax.sql.DataSource; | ||
|
||
import org.apache.commons.dbcp2.BasicDataSource; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.integration.jdbc.channel.PostgresContainerTest; | ||
import org.springframework.jdbc.datasource.DataSourceTransactionManager; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.springframework.transaction.PlatformTransactionManager; | ||
|
||
/** | ||
* @author Johannes Edmeier | ||
* @author Artem Bilan | ||
* | ||
* @since 6.2 | ||
*/ | ||
@ContextConfiguration | ||
public class PostgresJdbcChannelMessageStoreTests extends AbstractJdbcChannelMessageStoreTests | ||
implements PostgresContainerTest { | ||
|
||
@Configuration | ||
public static class Config { | ||
|
||
@Bean | ||
public DataSource dataSource() { | ||
BasicDataSource dataSource = new BasicDataSource(); | ||
dataSource.setUrl(PostgresContainerTest.getJdbcUrl()); | ||
dataSource.setUsername(PostgresContainerTest.getUsername()); | ||
dataSource.setPassword(PostgresContainerTest.getPassword()); | ||
return dataSource; | ||
} | ||
|
||
@Bean | ||
PlatformTransactionManager transactionManager(DataSource dataSource) { | ||
return new DataSourceTransactionManager(dataSource); | ||
} | ||
|
||
@Bean | ||
PostgresChannelMessageStoreQueryProvider queryProvider() { | ||
return new PostgresChannelMessageStoreQueryProvider(); | ||
} | ||
|
||
} | ||
|
||
} |
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