Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33

Thread: spring config/channel error/error handler

  1. #11
    Join Date
    Jun 2011
    Posts
    26

    Default Still having a minor issue

    So I have verified that I am now dependent on spring-amqp.1.0.0.RC2 rather than the snapshot. However I am still experiencing the same issue.

    For the inbound channel adapter

    queue-names gets a validation error in the ide, but works upon runtime (app works as expected)
    queue-name passes validation in ide but fails at runtime. queue-name seems correct in the doc.

    xmlns:amqp="http://www.springframework.org/schema/integration/amqp"

    my schema location:
    http://www.springframework.org/schema/integration/amqp
    http://www.springframework.org/schem...n-amqp-2.0.xsd

    I know this is something that I am doing wrong.

  2. #12
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    What version of STS are you using?

  3. #13
    Join Date
    Jun 2011
    Posts
    26

    Default 2.1 xsd

    STS v2.6

    To confirm I am using spring-integration-amqp.2.1.0-BUILD-SNAPSHOT

    in the config package is the 2.0.xsd

    in the definitions it defines queue-names as required

  4. #14
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    If it works at runtime you should be able to ignore errors in the XML editor, and "queue-names" is the correct attribute name. Sometimes you need to force a re-validation to make them go away, e.g. select all, cut, save, refresh dependencies (little icon in the toolbar), paste, save.

  5. #15
    Join Date
    Jun 2011
    Posts
    26

    Default Last error

    Ok thank you guys for all of your help. App is running but now with this new inbound channel adapter I seem to be getting only every other message. Since its an even number and consistent I would assume this is a channel issue, am I on the right track?

  6. #16
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    Interesting. Are you sure that you only have one active consumer on the Queue?

  7. #17
    Join Date
    Jun 2011
    Posts
    26

    Default multiple queues

    interesting

    rabbitmqctl list_queues consumers does list 2 however only one app is running. Is this a residual effect from another app on same queue or is declaring a queue along with an inbound channel redundant?

    I assume queue-names in the channel adapter is just a ref to an already declared queue.

    activemq was so much easier to manage than rabbitmq...

  8. #18
    Join Date
    Jun 2011
    Posts
    26

    Default Unknown channel 3

    so now that I got through all that, I am now getting an unknown channel 3 error, and still getting 2 consumers per app.

    Is this a result of me just not knowing what I am doing or just the early stages of development and the implementation just not quite there?

  9. #19
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    I would say probably the former, since the implementation is near to final release, but if there are really problems then we'd like to get more detailed feedback now (e.g. a stack trace on that error). Can you post your configuration? Still looks to me like you have another consumer process running somewhere. It works pretty seamlessly for others, and I don't think there is such a big learning curve if you are au fait with messaging in general. Most people say how easy it is to set up compared to ActiveMQ, so the contrast is interesting.

  10. #20
    Join Date
    Jun 2011
    Posts
    26

    Default Issues

    I am almost positive it is my fault but I had not problems with JMS/ActiveMQ for some reason this rabbit stuff is throwing me for a loop

    here is my config:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:rabbit="http://www.springframework.org/schema/rabbit"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:amqp="http://www.springframework.org/schema/integration/amqp"
    xsi:schemaLocation="http://www.springframework.org/schema/rabbit
    http://www.springframework.org/schem...rabbit-1.0.xsd
    http://www.springframework.org/schema/integration/amqp
    http://www.springframework.org/schem...n-amqp-2.0.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <!-- RabbitMQ -->
    <bean id="cf" class="org.springframework.amqp.rabbit.connection. SingleConnectionFactory">
    <constructor-arg value="localhost"/>
    <property name="Username" value="guest"/>
    <property name="Password" value="guest"/>
    </bean>
    <bean id="rabbitTemplate" class="org.springframework.amqp.rabbit.core.Rabbit Template">
    <property name="connectionFactory">
    <ref bean="cf"/>
    </property>
    <property name="exchange" value="executions"/>
    </bean>
    <bean id="messageSender" class="com.trendfx.fixclient.amqp.ExecutionProduce r">
    <property name="Template">
    <ref bean="rabbitTemplate"/>
    </property>
    </bean>
    <bean id="adminSender" class="com.trendfx.fixclient.amqp.AdminProducer">
    <property name="Template">
    <ref bean="rabbitTemplate"/>
    </property>
    </bean>
    <rabbit:admin id="amqpAdmin" connection-factory="cf"/>
    <rabbit:queue name="queue.trades" durable="true"/>

    <bean id="TradeChannel" class="org.springframework.integration.channel.Que ueChannel"/>
    <amqp:inbound-channel-adapter queue-names="queue.trades"
    channel="TradeChannel"
    connection-factory="cf"/>
    <amqp:outbound-channel-adapter channel=""/>


    <!-- Hibernate -->
    <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost/**********" />
    <property name="username" value="*********r" />
    <property name="password" value="**********" />
    </bean>
    <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="myDataSource" />
    <property name="mappingResources">
    <list>
    <value>HibernateMap.hbm.xml</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <value>
    hibernate.dialect=org.hibernate.dialect.MySQL5Inno DBDialect
    </value>
    </property>
    </bean>
    <bean id="fixclientDao" class="com.trendfx.fixclient.dao.FixclientDaoImpl"
    init-method="Start" destroy-method="Stop">
    <property name="sessionFactory" ref="mySessionFactory"/>
    <property name="ExecutionProducer" ref="messageSender"/>
    </bean>

    <!-- QuickFixJ -->
    <bean id="sessionSettings" class="quickfix.SessionSettings">
    <constructor-arg value="/home/bobby/MirageFX/MirageFix/mbtdemo.fix" />
    </bean>
    <bean id="fileStoreFactory" class="quickfix.FileStoreFactory">
    <constructor-arg ref="sessionSettings"/>
    </bean>
    <bean id="LogFactory" class="quickfix.FileLogFactory">
    <constructor-arg ref="sessionSettings"/>
    </bean>
    <bean id="messageFactory" class="quickfix.DefaultMessageFactory"/>
    <bean id="fixApplication" class="com.trendfx.fixclient.implementations.MbtCl ient">
    <property name="Sender" value="*************"/>
    <property name="Target" value="*************"/>
    <property name="FixclientDaoImpl" ref="fixclientDao"/>
    </bean>
    <bean id="socketInitiator" class="quickfix.SocketInitiator">
    <constructor-arg index="0" ref="fixApplication" />
    <constructor-arg index="1" ref="fileStoreFactory" />
    <constructor-arg index="2" ref="sessionSettings" />
    <constructor-arg index="3" ref="LogFactory" />
    <constructor-arg index="4" ref="messageFactory" />
    </bean>

    <bean id="basicChecks" class="com.trendfx.fixclient.risk.BasicChecks"
    init-method="Start" destroy-method="Stop">
    <property name="sessionFactory" ref="mySessionFactory"/>
    </bean>

    <bean id="fixSession" class="com.trendfx.fixclient.util.FixSession">
    <!-- init-method="Start" destroy-method="Stop"> -->
    <property name="fixApplication" ref="fixApplication" />
    <property name="socketInitiator" ref="socketInitiator" />
    <property name="basicChecks" ref="basicChecks" />
    </bean>

    <!--
    <bean class="org.springframework.amqp.rabbit.listener.Si mpleMessageListenerContainer">
    <property name="ConnectionFactory" ref="cf"/>
    <property name="QueueNames" value="TradeMessages"/>
    <property name="MessageListener" ref="fixSession"/>
    </bean>
    -->

    <rabbit:listener-container connection-factory="cf">
    <rabbit:listener queues="queue.trades" ref="fixSession"/>
    </rabbit:listener-container>
    </beans>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •