Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4822

Enhance JdbcMessageIdRepository so that custom tables and SQL can be easily used

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.8.3
    • 2.9.0
    • camel-sql
    • Patch Available
    • Moderate

    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.

      Attachments

        1. CAMEL-4822-patch.txt
          15 kB
          Philip Glebow

        Activity

          People

            davsclaus Claus Ibsen
            pglebow Philip Glebow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: