如何从骆驼连接并发送消息到修复服务器

How to connect and send msg to Fix server from camel

我需要创建这样的路线: 解析 csv 文件 -> 创建修复字符串 -> 将其发送到外部修复服务器。 所以。如何在 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

但是我得到这样的错误:

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

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

<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 to work out how to set them up in a way that's right for you. The comments above are the default classes in the quickfixj. package that are used by the component in the unit tests