Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration 带有OracleJdbcMessageStore的ORA-01795_Spring Integration - Fatal编程技术网

Spring integration 带有OracleJdbcMessageStore的ORA-01795

Spring integration 带有OracleJdbcMessageStore的ORA-01795,spring-integration,Spring Integration,我已经设置了一个ExpressionEvaluationRequestHandlerAdvice,它在成功(到日志)或失败(回到messagestore)时“转发”负载。 当我的服务正常运行一段时间并正确轮询配置的jdbc通道消息存储时,在处理1000条消息后会引发以下异常 2018-04-18 09:17:20,427 | ERROR | taskExecutor-1 | session=- user=- | o.s.i.h.LoggingHandler | org.

我已经设置了一个ExpressionEvaluationRequestHandlerAdvice,它在成功(到日志)或失败(回到messagestore)时“转发”负载。 当我的服务正常运行一段时间并正确轮询配置的jdbc通道消息存储时,在处理1000条消息后会引发以下异常

 2018-04-18 09:17:20,427 | ERROR | taskExecutor-1   | session=- user=- | o.s.i.h.LoggingHandler           | org.springframework.integration.handler.LoggingHandler            192 | org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT INT_CHANNEL_MESSAGE.MESSAGE_ID, INT_CHANNEL_MESSAGE.MESSAGE_BYTES from INT_CHANNEL_MESSAGE where INT_CHANNEL_MESSAGE.GROUP_KEY = ? and INT_CHANNEL_MESSAGE.REGION = ? and INT_CHANNEL_MESSAGE.MESSAGE_ID not in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,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, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) order by MESSAGE_PRIORITY DESC NULLS LAST, CREATED_DATE, MESSAGE_SEQUENCE FOR UPDATE SKIP LOCKED]; nested exception is java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

 #011at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:91)
 #011at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
 #011at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)
 #011at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:655)
 #011at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:690)
 #011at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:717)
 #011at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:767)
 #011at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192)
 #011at org.springframework.integration.jdbc.store.JdbcChannelMessageStore.doPollForMessage(JdbcChannelMessageStore.java:607)
 #011at org.springframework.integration.jdbc.store.JdbcChannelMessageStore.pollMessageFromGroup(JdbcChannelMessageStore.java:557)
 #011at org.springframework.integration.store.MessageGroupQueue.doPoll(MessageGroupQueue.java:318)
 #011at org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:162)
 #011at org.springframework.integration.store.MessageGroupQueue.poll(MessageGroupQueue.java:49)
 #011at org.springframework.integration.channel.QueueChannel.doReceive(QueueChannel.java:116)
 #011at org.springframework.integration.channel.AbstractPollableChannel.receive(AbstractPollableChannel.java:105)
 #011at org.springframework.integration.endpoint.PollingConsumer.receiveMessage(PollingConsumer.java:192)
 #011at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:245)
 #011at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:58)
 #011at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:190)
 #011at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:186)
 #011at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:353)
 #011at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55)
 #011at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 #011at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 #011at java.lang.Thread.run(Thread.java:748)
 Caused by: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

 #011at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
 #011at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
 #011at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
 #011at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
 #011at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
 #011at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
 #011at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
 #011at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
 #011at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
 #011at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
 #011at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
 #011at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
 #011at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
 #011at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:698)
 #011at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639)
 #011... 21 more
似乎存在某种由Sftp处理程序allready处理的消息id缓存。我是否正确地处理了我的spring集成流程

您的问题在于:

 messageStore.setUsingIdCache(true);
参见其JavaDocs:

 * <p>Consider using this property when polling the database transactionally
 * using multiple parallel threads, meaning when the configured poller is configured
 * using a task executor.</p>
 * <p>The issue is that the {@link #pollMessageFromGroup(Object)} looks for the
 * oldest entry for a giving channel (groupKey) and region ({@link #setRegion(String)}).
 * If you do that with multiple threads and you are using transactions, other
 * threads may be waiting for that same locked row.</p>
 * <p>If using the provided {@link OracleChannelMessageStoreQueryProvider}, don't set {@link #usingIdCache}
 * to true, as the Oracle query will ignore locked rows.</p>

请注意(:message_id)中的
。这就是甲骨文限制我们使用
1000

Grazie Artem,就是这样。。。但我仍然不明白为什么在处理成功完成后,行仍然被锁定…嗯。那不可能。必须从数据库中删除原始数据。尝试为
PollerMetadata.setAdviceChain()配置
TransactionInterceptor
public String getPriorityPollFromGroupExcludeIdsQuery() {
    return "SELECT %PREFIX%CHANNEL_MESSAGE.MESSAGE_ID, %PREFIX%CHANNEL_MESSAGE.MESSAGE_BYTES from %PREFIX%CHANNEL_MESSAGE " +
            "where %PREFIX%CHANNEL_MESSAGE.GROUP_KEY = :group_key and %PREFIX%CHANNEL_MESSAGE.REGION = :region " +
            "and %PREFIX%CHANNEL_MESSAGE.MESSAGE_ID not in (:message_ids) " +
            "order by MESSAGE_PRIORITY DESC NULLS LAST, CREATED_DATE, MESSAGE_SEQUENCE FOR UPDATE SKIP LOCKED";
}