如何从驼峰连接并发送msg到Fix服务器

时间:2016-03-03 08:56:18

标签: apache-camel fix-protocol

我需要创建这样的路线: 解析csv文件 - >创建修复字符串 - >将其发送到外部FIX服务器。 所以。我如何在camel xml配置中建立连接并使用camel-quickfx模块发送它? 我有这样的代码:

    <route>
        <from uri="direct:processOneLine2"/>
        <bean ref="orderBean" method="createFixMessage"/>
        <to uri="quickfix-client:META-INF/quickfix/client.cfg"/>
    </route>

配置:

    [DEFAULT]
ConnectionType=initiator
ReconnectInterval=60
SenderCompID=TW


[SESSION]
BeginString=FIX.4.4
TargetCompID=ARCA
StartTime=12:30:00
EndTime=23:30:00
HeartBtInt=20
SocketConnectPort=3313
SocketConnectHost=localhost
DataDictionary=FIX44.xml

但是我得到了这样的错误:

  

引起:org.apache.camel.RuntimeCamelException:org.apache.camel.FailedToCreateRouteException:无法在以下位置创建路由route1:&gt;&gt;&gt;至[quickfix-client:META-INF / quickfix / client.cfg]&lt;&lt;&lt;在路线:路线(路线1)[[Fr.   om [direct:processOneLine2]] - &gt; [Bean [ref:或...因为无法解析端点:quickfix-client://META-INF/quickfix/client.cfg,原因是:找不到使用scheme的组件:quickfix-client

1 个答案:

答案 0 :(得分:0)

根据您需要定义的错误消息:

<bean id="quickfix-client" 
      class="org.apache.camel.component.quickfixj.QuickfixjComponent">
  <property name="messageFactory" ref=".."/> <!-- DefaultMessageFactory -->
  <property name="messageStoreFactory" ref=".."/> <!-- MemoryStoreFactory -->
  <property name="logFactory" ref=".."/> <!-- ScreenLogFactory -->
</bean>

属性本身是QuickFIX / J类,您需要回顾QuickFIX/J documentation以了解如何以适合您的方式设置它们。上面的注释是unit tests中组件使用的quickfixj.包中的默认类。