Announcement Announcement Module
No announcement yet.
Error while using spring integration- jdbc message store Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while using spring integration- jdbc message store

    I am new to spring-integration and have a requirement where I have to store all message received by a channel to jdbc message-store. In details all messages received by message-driven-channel-adapter need to be stored in jdbc-message-store. I am using sybase as db storage.
    Here is my spring config :

    <si:channel id="allMessages"/>
    <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFacto ry">
    <property name="brokerURL" value="tcp://localhost:61616"/>

    <jms:message-driven-channel-adapter pub-sub-domain="true" channel="allMessages" connection-factory="connectionFactory" destination-name=">" extract-payload="false" />

    <si:service-activator input-channel="allMessages" output-channel="dbBackedChannel" method="extract">
    <bean class="com.sample.Extractor" init-method="init" />

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
    <property name="driverClassName" value="com.sybase.jdbc3.jdbc.SybDriver" />
    <property name="url" value="jdbc:sybase:Tds:localhost:10170/ltr_dev" />
    <property name="username" value="someuser" />
    <property name="password" value="password" />

    <si:channel id="dbBackedChannel">
    <si:queue message-store="messageStore"/>

    <si-jdbc:message-store id="messageStore" data-source="dataSource" />

    I am getting below exception :

    Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT COUNT(MESSAGE_ID) from INT_MESSAGE_GROUP where GROUP_KEY=? AND REGION=?]; nested exception is com.sybase.jdbc3.jdbc.SybSQLException: INT_MESSAGE_GROUP not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).

    at ceptionTranslator.doTranslate(SQLErrorCodeSQLExcep
    at QLExceptionTranslator.translate(AbstractFallbackSQ
    at org.springframework.jdbc.core.JdbcTemplate.execute (
    at org.springframework.jdbc.core.JdbcTemplate.query(J
    at org.springframework.jdbc.core.JdbcTemplate.query(J
    at org.springframework.jdbc.core.JdbcTemplate.query(J

    I understand that message-store will try to insert message in table formed by schema placed in org.springframework.integration.jdbc package in spring-integration-jdbc jar. But can any one help me here in figuring out what I am doing wrong ?

  • #2

    INT_MESSAGE_GROUP not found
    Does you SYBASE (jdbc:sybase:Tds:localhost:10170/ltr_dev) really have tables for Spring Integration Message Store from this script:

    Take care,