Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

INT-2980 Jdbc Message Store: Polling Wrong Message #781

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants
Member

ghillert commented Apr 10, 2013

  • Add Join to JDBC Query
  • Add MySql-specific tests
  • INT-2987 - MessageStore MySQL - Support Fractional Seconds
    • Update MySql Connector version to 5.1.24
    • Add DDL scripts for MySql versions 5.6.4 and higher
Member

ghillert commented Apr 10, 2013

Will add documentation for Reference Doc to the PR (Especially for INT-2987) later today.

@artembilan artembilan and 1 other commented on an outdated diff Apr 10, 2013

...pringframework/integration/jdbc/JdbcMessageStore.java
"(SELECT min(CREATED_DATE) from %PREFIX%MESSAGE, %PREFIX%GROUP_TO_MESSAGE " +
"where %PREFIX%MESSAGE.MESSAGE_ID = %PREFIX%GROUP_TO_MESSAGE.MESSAGE_ID " +
"and %PREFIX%GROUP_TO_MESSAGE.GROUP_KEY = ? " +
- "and %PREFIX%MESSAGE.REGION = ?))"),
+ "and %PREFIX%MESSAGE.REGION = ?) " +
+ "and %PREFIX%GROUP_TO_MESSAGE.GROUP_KEY = ?)"),
@artembilan

artembilan Apr 10, 2013

Member

Hi, Gunnar!
and and %PREFIX%GROUP_TO_MESSAGE.REGION = ? has to be here too: we may have several applications with the same DB, that have the same channel, but in different regions.

@ghillert

ghillert Apr 10, 2013

Member

Thanks for catching this - This happens when you don't have a test-case catching this. Will be fixed shortly.

@artembilan artembilan and 1 other commented on an outdated diff Apr 10, 2013

...pringframework/integration/jdbc/JdbcMessageStore.java
@@ -606,7 +609,7 @@ protected JdbcOperations getJdbcOperations(){
* @return a message; could be null if query produced no Messages
*/
protected Message<?> doPollForMessage(String groupIdKey) {
- List<Message<?>> messages = jdbcTemplate.query(getQuery(Query.POLL_FROM_GROUP), new Object[] { groupIdKey, region }, mapper);
+ List<Message<?>> messages = jdbcTemplate.query(getQuery(Query.POLL_FROM_GROUP), new Object[] { groupIdKey, region, groupIdKey }, mapper);
@artembilan

artembilan Apr 10, 2013

Member

How about to use here NamedParameterJdbcTemplate as you've done in the JdbcChannelMessageStore#doPollForMessage ?

@ghillert

ghillert Apr 10, 2013

Member

Thought about that. This would ideally mean, however, that the JdbcMessageStore class itself would use the NamedParameterJdbcOperations interface with the NamedParameterJdbcTemplate implementation. Not sure that I want to introduce some potential breaking changes for that.

Member

ghillert commented Apr 10, 2013

Committed some additional documentation. The PR should now be complete.

@garyrussell garyrussell commented on the diff Apr 15, 2013

src/reference/docbook/jdbc.xml
+ <itemizedlist>
+ <listitem>schema-drop-mysql-5_6_4.sql</listitem>
+ <listitem>schema-mysql-5_6_4.sql</listitem>
+ </itemizedlist>
+ <para>
+ For more information, please see:
+ </para>
+ <para>
+ <ulink url="http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html"></ulink>
+ </para>
+ <para>
+ Also important, please ensure that you use an up-to-date version
+ of the JDBC driver for MySQL (Connector/J), e.g. version
+ <emphasis>5.1.24</emphasis> or higher.
+ </para>
+ </note>
</section>
@garyrussell

garyrussell Apr 15, 2013

Member

Maybe a mention in "What's New?" too? (perhaps just a pointer to this note).

@ghillert

ghillert Apr 15, 2013

Member

Done and pushed.

Gunnar Hillert added some commits Apr 10, 2013

Gunnar Hillert INT-2980 Jdbc Message Store: Polling Wrong Message
* Add Join to JDBC Query
* Add MySql-specific tests
* INT-2987 - MessageStore MySQL - Support Fractional Seconds
  - Update MySql Connector version to 5.1.24
  - Add DDL scripts for MySql versions 5.6.4 and higher
efa6f8b
Gunnar Hillert INT-2980 - Check also for Regions
* Add test
bcfab9b
Gunnar Hillert INT-2980/INT-2987 - Add Documentation f68d000
Gunnar Hillert INT-2980 - Doc: Add info to What's New Section cbf4527
Member

ghillert commented Apr 17, 2013

Rebased.

Member

garyrussell commented Apr 24, 2013

LGTM; merging

@garyrussell garyrussell added a commit to garyrussell/spring-integration that referenced this pull request Apr 24, 2013

@garyrussell garyrussell Merge pull request #781 from ghillert/INT-2980 5e7aa59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment