Mule and QuickFIX/J integration

 

 

Mule and QuickFIX/J integration

           (configuration and code NOT be verified)

一.   Requirement, Installation.

TODO

二.   Configuration.

1.       Declare the namespace, the following example just contains:mule, spring ,vm, and fix

 

 

<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
      xmlns:fix="http://www.mulesource.org/schema/mule/fix/2.2"
    xsi:schemaLocation="http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
       http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.mulesource.org/schema/mule/vm/2.2   http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
       http://www.mulesource.org/schema/mule/fix/2.2  http://www.mulesource.org/schema/mule/fix/2.2/mule-fix.xsd">
 

 

 

2. Defined the fix connector and endpoint

 a) Connector

<fix:connector name="fixConnector" config="./fix/fix-setting.cfg"/>
 

 

               b)  Endpoing

<fix:endpoint name="zhFixIncoming"     sessionID="FIX.4.4:XMLHK-XMLZH"/>
<fix:endpoint name="hkExFixIncoming"  sessionID="FIX.4.4:XMLHK-HKEx"/>
 

Actually, the sessionID would be look like as FIX.4.4:XMLHK->XMLZH

 

3. Defined the message transformer(Optional)

4.   Defined the fix session setting

Config the fix session setting, more info can refer to http://www.quickfixj.org/quickfixj/usermanual/usage/configuration.html

 

[default]
FileStorePath=log/data 
FileLogPath=log/log
ReconnectInterval=5
HeartBtInt=30
LogonTimeout=60	
PersistMessages=Y

[session]
BeginString=FIX.4.4
ConnectionType=acceptor
SenderCompID=XMLHK
TargetCompID=XMLZH
StartTime=00:00:00
EndTime=00:00:00
SocketAcceptAddress=192.168.1.1
SocketAccetpPort=3030
TimeZone=Asia/Hong_Kong

[session]
BeginString=FIX.4.4
ConnectionType=initiator
SenderCompID=XMLHK
TargetCompID=HKEx
StartTime=00:00:00
EndTime=00:00:00
SocketConnectHost=192.168.1.2
SocketConnectPort=3031
TimeZone=Asia/Hong_Kong
ResetOnLogon=Y
 

 

Note: the first session can be regard to a sell side and the other is a buy side.

 

5.   The mule model and service.

 <model>
		<service name="zhFixIncomingService">
			<inbound>
				<inbound-endpoint ref="zhFixIncoming"/>
			</inbound>
			<component>
				<spring-object bean="zhFixIncomingMessageService"
			</component>
			<outbound>
				<pass-through-router>
					<outbound-endpoint ref="hkExFixIncoming"/>
				</pass-through-router>
			</outbound>
		</service>
		
		<service name="hkExFixIncomingService">
			<inbound>
				<inbound-endpoint ref="hkExFixIncoming"/>
			</inbound>
			<component>
				<spring-object bean="hkExFixIncomingMessageService"
			</component>
			<outbound>
				<pass-through-router>
					<outbound-endpoint ref="zhFixIncoming" />
				</pass-through-router>
			</outbound>
		</service>
</model>

 

 

 

6.    Spring bean configuration

 

<spring:bean id="zhFixIncomingMessageService" class="com…ZhFixIncomingMessageService">
</spring:bean>

<spring:bean id="hkExFixIncomingMessageService" class="com…hkExFixIncomingMessageService">
</spring:bean>
 

 

 

 

7.    Java code:

 

 a)   zhFixIncomingMessageService

 

 

public class ZhFixIncomingMessageService implements Callable{
	public Object onCall(MuleEventContext context) throws MuleException {
		TODO all fix message from first session will be processed through this callback method.
	}
}
 

 

b)   hkExFixIncomingSerivce

  

public class HkFixIncomingMessageService implements Callable{
	public Object onCall(MuleEventContext context) throws MuleException {
		TODO all fix message from second session will be processed through this callback method.
	}
}
 

 

 

8.     TODO

 

 

三.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值