Details
Description
The existing JdbcMessageIdRepository is tied to a particular table (CAMEL_MESSAGEPROCESSED) and includes an INSERT statement that is incompatible with MS SQL Server. The design of the class makes it difficult to change the table name and related SQL statements. In some environments, table names and structures are strictly controlled and it would be nice to be able to change these things easily. It would also be nice for this to work on a variety of databases, including MS SQL Server.
I've submitted a patch that refactors the design of the class so that it can be easily extended. An abstract base class called AbstractJDBCIdempotentRepository has been introduced that takes care of the plumbing required to query, insert and delete. Classes that extend this abstract base class need only implement the query, insert, and delete operations. This makes it very easy to customize an idempotent repository for a particular environment.
The existing JdbcMessageIdRepository has been changed to extend the AbstractJDBCIdempotentRepository and has retained the SQL statements present in the prior version. A patch is attached to this JIRA and the existing unit test passes after applying this patch.