I'm using Mysql as message store DB, just tried to upgrade to spring integration 5.5.5, but found the schema changed,
there requires a CONDITION column in INT_MESSAGE_GROUP table, although I can create the table by adding backtick around CONDITION, there is a sql in JdbcMessageStore.java
GET_GROUP_INFO("SELECT COMPLETE, LAST_RELEASED_SEQUENCE, CREATED_DATE, UPDATED_DATE, CONDITION" +
" from %PREFIX%MESSAGE_GROUP where GROUP_KEY=? and REGION=?")
it cannot work? any work-around?
Yes, I see now. Looks like
conditionis a reserved word in MySQL: Is condition considered a special word in mySQL?. Not sure how I have missed that, but this is considered as a bug and have to be really fixed from the framework perspective.The workaround depend on the fact what you are doing with that
JdbcMessageStore. If you use it from the queue channel, then it is better to look into aJdbcChannelMessageStoreinstead: https://docs.spring.io/spring-integration/docs/current/reference/html/jdbc.html#jdbc-message-store-channels.If you really deal with an aggregator, then you have to extend
JdbcMessageStoreand overridegetGroupMetadata()andsetGroupCondition()where aCONDITIONis in use for SQL statements.Or just look into some other DB vendor which doesn't reserve
CONDITIONword!I'm going to fix it via
GROUP_CONDITIONword instead...UPDATE
The fix for the framework code is here: https://github.com/spring-projects/spring-integration/pull/3687. The next Spring Integration
5.5.7will be released like this: https://github.com/spring-projects/spring-integration/milestone/80. Just in time for the next Spring Boot versions!