Announcement Announcement Module
Collapse
No announcement yet.
Error while using spring integration- jdbc message store Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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"/>
    </bean>

    <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" />
    </si:service-activator>

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <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" />
    </bean>

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

    <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 org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.doTranslate(SQLErrorCodeSQLExcep tionTranslator.java:233)
    at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:72)
    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:602)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:636)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:665)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:673)

    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
    Hi!

    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:
    https://github.com/SpringSource/spri...ema-sybase.sql
    ?

    Take care,
    Artem

    Comment

    Working...
    X