2016-03-03 65 views
0

我需要创建这样的路由: 解析csv文件 - > create Fix String - >将它发送到外部FIX服务器。 所以。我如何在骆驼xml配置中建立连接并将它与camel-quickfx模块一起发送? 我有这样的代码:如何连接并发送msg到骆驼的Fix服务器

<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 

,但我得到这样的错误:

Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[quickfix-client:META-INF/quickfix/client.cfg] <<< in route: Route(route1)[[Fr om[direct:processOneLine2]] -> [Bean[ref:or... because of Failed to resolve endpoint: quickfix-client://META-INF/quickfix/client.cfg due to: No component found with scheme: quickfix-client

+0

你的问题是关于如何使用camel-quickfix或整个路由连接到服务器? –

+0

只有如何连接到服务器 – user3756506

回答

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.软件包中的默认类。