Details
Description
If I want to use JdbcMessageIdRepository and add the schema name as prefix to the CAMEL_MESSAGEPROCESSED table name, I can do something like this:
idempotentRepository.setTableName("myschema.CAMEL_MESSAGEPROCESSED");
(the idempotentRepository is registered as bean in the CamelContext).
But when using the idempotentRepository with an idempotentConsumer in a route, I get the following error:
org.apache.camel.RuntimeCamelException: org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT 1 FROM myschema.myschema.CAMEL_MESSAGEPROCESSED WHERE 1 = 0]; SQL state [0A000]; error code [0]; ERROR: cross-database references are not implemented: "myschema.myschema.camel_messageprocessed" Position: 15; nested exception is org.postgresql.util.PSQLException: ERROR: cross-database references are not implemented: "myschema.myschema.camel_messageprocessed" Position: 15
The query is generated with a double schema name prefix (myschema.myschema.camel_messageprocessed).
JdbcMessageIdRepository is designed to replace the CAMEL_MESSAGEPROCESSED substring in the queries with the custom table name in the onInit() function, but looks like this function is called multiple times and it keeps replacing the substring that is present also in the custom table name.
Attachments
Issue Links
- links to