You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by pglebow <pg...@gmail.com> on 2011/12/23 01:40:54 UTC

Enhancement - JdbcMessageIdRepository should be easy to extend so custom SQL and tables can be used

I've submitted a JIRA and a patch relating to JdbcMessageIdRepository in the
camel-sql component:

https://issues.apache.org/jira/browse/CAMEL-4822

The existing JdbcMessageIdRepository is not compatible with MS SQL Server
(insert of a Timestamp is not supported by this database) and it was very
difficult to extend this class to change the SQL/table.  I've submitted a
patch that refactors the class to use an abstract base class.  This allows
others to easily extend the class to customize it to a specific environment.  

To implement a custom message ID repository, only three methods need to be
implemented to perform the query, insert and delete operations.

The existing JdbcMessageIdRepository behavior is preserved and the unit test
passes after the change.  I hope this is useful to other users of Apache
Camel.  Happy Holidays!

--
View this message in context: http://camel.465427.n5.nabble.com/Enhancement-JdbcMessageIdRepository-should-be-easy-to-extend-so-custom-SQL-and-tables-can-be-used-tp5095987p5095987.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Enhancement - JdbcMessageIdRepository should be easy to extend so custom SQL and tables can be used

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for working on this. This is a good idea so people can adjust
it to their RDMBS of choice.


On Fri, Dec 23, 2011 at 1:40 AM, pglebow <pg...@gmail.com> wrote:
> I've submitted a JIRA and a patch relating to JdbcMessageIdRepository in the
> camel-sql component:
>
> https://issues.apache.org/jira/browse/CAMEL-4822
>
> The existing JdbcMessageIdRepository is not compatible with MS SQL Server
> (insert of a Timestamp is not supported by this database) and it was very
> difficult to extend this class to change the SQL/table.  I've submitted a
> patch that refactors the class to use an abstract base class.  This allows
> others to easily extend the class to customize it to a specific environment.
>
> To implement a custom message ID repository, only three methods need to be
> implemented to perform the query, insert and delete operations.
>
> The existing JdbcMessageIdRepository behavior is preserved and the unit test
> passes after the change.  I hope this is useful to other users of Apache
> Camel.  Happy Holidays!
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Enhancement-JdbcMessageIdRepository-should-be-easy-to-extend-so-custom-SQL-and-tables-can-be-used-tp5095987p5095987.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/