Skip to content

JdbcChannelMessageStore is not a MessageGroupStore #3878

Closed
@jesperdj

Description

@jesperdj

In what version(s) of Spring Integration are you seeing this issue?

4.3.24.RELEASE

Describe the bug

The API documentation of org.springframework.integration.jdbc.store.JdbcChannelMessageStore says that this is an implementation of MessageGroupStore, but that is not in fact the case, and therefore JdbcChannelMessageStore is not usable in a delayer (DelayHandler).

In fact, JdbcChannelMessageStore is a PriorityCapableChannelMessageStore, which is a ChannelMessageStore, which is a BasicMessageGroupStore. But BasicMessageGroupStore is NOT a MessageGroupStore; it's the other way around: MessageGroupStore extends BasicMessageGroupStore.

To Reproduce

Try using a JdbcChannelMessageStore as the message store in a DelayHandler. I'm doing this with XML configuration: <int:delayer message-store="myStore" ... /> where myStore refers to a JdbcChannelMessageStore.

You will get an error that says that JdbcChannelMessageStore cannot be converted to MessageGroupStore:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aanbiedenVerzoekRetryChain$child.aanbiedenVerzoekDelayer.handler': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.integration.jdbc.store.JdbcChannelMessageStore' to required type 'org.springframework.integration.store.MessageGroupStore' for property 'messageStore'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'org.springframework.integration.jdbc.store.JdbcChannelMessageStore' to required type 'org.springframework.integration.store.MessageGroupStore' for property 'messageStore': no matching editors or conversion strategy found

Expected behavior

JdbcChannelMessageStore should implement interface MessageGroupStore.

Possible alternative solution: Make DelayHandler not require that the message store is a MessageGroupStore; it seems that it doesn't call any methods beyond BasicMessageGroupStore anyway.

Note that JdbcChannelMessageStore is not a MessageStore either, which is most likely also a problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions