You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Vid Cheruvu (JIRA)" <ji...@apache.org> on 2010/09/28 09:15:43 UTC

[jira] Issue Comment Edited: (CAMEL-1350) camel-quickfix component in apache camel distribution

    [ https://issues.apache.org/activemq/browse/CAMEL-1350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62184#action_62184 ] 

Vid Cheruvu edited comment on CAMEL-1350 at 9/28/10 3:15 AM:
-------------------------------------------------------------

+1 for QuickFix. I have manged to run Steve's code and able to persist FIX messages to Mysql server database and also tested few cases i.e resend. It worked nicely without much effort. 

Below are the code snippet of route builder where orders from Banzai are routed to EXEC through the FIXGW (Camel-quickfix) . Then exec reports from EXEC are routed back to BANZAI and also I have added multicast to see FIX message can be broadcasted to other fix sessions.  My camel process can be both acceptor and initiator.

Great work Steve, it looks great.

//from Banzai (Intiator) to EXEC(Acceptor) through FIXGW (mediator)
		from("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->BANZAI").
		filter(PredicateBuilder.and(
		  header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
		  header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.ORDER_SINGLE))).
		
       to("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->EXEC");
		
		
		//from executor(acceptor) to BANZAI(initiator) through FIXGW (Mediator) 
		from("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->EXEC")
   	 	.filter(PredicateBuilder.and(
        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
        header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EXECUTION_REPORT)))
        .multicast()
        	.stopOnException()
        	.to("direct:banzai","direct:banzai2")
        .end();
		
		from("direct:banzai").to("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->BANZAI");
		from("direct:banzai2").to("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->BANZAI2");


---mediator.cfg settings ---

[default]
UseJmx=Y
SocketAcceptProtocol=SOCKET
SocketConnectProtocol=SOCKET
PersistMessages=Y
StartTime=00:00:00
EndTime=00:00:00
HeartBtInt=30
ScreenLogEvents=N
ScreenLogShowIncoming=N
ScreenLogShowOutgoing=N
ValidateUserDefinedField=N
JdbcURL=jdbc:mysql://localhost:3306/quickfix
JdbcDriver=com.mysql.jdbc.Driver
JdbcUser=root
JdbcPassword=


[session]
ConnectionType=initiator
BeginString=FIX.4.2
SenderCompID=FIXGW
TargetCompID=EXEC
SocketConnectHost=127.0.0.1
SocketConnectPort=1100


[session]
ConnectionType=acceptor
BeginString=FIX.4.2
SenderCompID=FIXGW
TargetCompID=BANZAI2
SocketAcceptPort=7002

[session]
ConnectionType=acceptor
BeginString=FIX.4.2
SenderCompID=FIXGW
TargetCompID=BANZAI
SocketAcceptPort=10000

      was (Author: v_cheruvu@hotmail.com):
    +1 for QuickFix. I have manged to run Steve's code and able to persist FIX messages to Mysql server database and also tested few cases i.e resend. It worked nicely without much effort. 

Below are the code snippet of route builder where orders from Banzai are routed to EXEC through the FIXGW (Camel-quickfix) . Then exec reports from EXEC are routed back to BANZAI and also I have added multicast to see FIX message can be broadcasted to other fix sessions.  My camel process can be both acceptor and initiator.

Great work Steve, it looks great.

//from Banzai (Intiator) to EXEC(Acceptor) through FIXGW (mediator)
		from("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->BANZAI").
		filter(PredicateBuilder.and(
		  header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
		  header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.ORDER_SINGLE))).
		
       to("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->EXEC");
		
		
		//from executor(acceptor) to BANZAI(initiator) through FIXGW (Mediator) 
		from("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->EXEC")
   	 	.filter(PredicateBuilder.and(
        header(QuickfixjEndpoint.EVENT_CATEGORY_KEY).isEqualTo(QuickfixjEventCategory.AppMessageReceived),
        header(QuickfixjEndpoint.MESSAGE_TYPE_KEY).isEqualTo(MsgType.EXECUTION_REPORT)))
        .multicast()
        	.stopOnException()
        	.to("direct:banzai","direct:banzai2")
        .end();
		
		from("direct:banzai").to("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->BANZAI");
		from("direct:banzai2").to("quickfixj:quickfix/mediator.cfg?sessionID=FIX.4.2:FIXGW->BANZAI2");


---mediator.cfg settings ---

[default]
UseJmx=Y
SocketAcceptProtocol=SOCKET
SocketConnectProtocol=SOCKET
PersistMessages=Y
StartTime=00:00:00
EndTime=00:00:00
HeartBtInt=30
ScreenLogEvents=N
ScreenLogShowIncoming=N
ScreenLogShowOutgoing=N
ValidateUserDefinedField=N
JdbcURL=jdbc:mysql://localhost:3306/quickfix
JdbcDriver=com.mysql.jdbc.Driver
JdbcUser=root
JdbcPassword=

#
# Initiator for simulating a trader
#
[session]
ConnectionType=initiator
BeginString=FIX.4.2
SenderCompID=FIXGW
TargetCompID=EXEC
SocketConnectHost=127.0.0.1
SocketConnectPort=1100

#
# Acceptor for simulating the market
#
[session]
ConnectionType=acceptor
BeginString=FIX.4.2
SenderCompID=FIXGW
TargetCompID=BANZAI2
SocketAcceptPort=7002

[session]
ConnectionType=acceptor
BeginString=FIX.4.2
SenderCompID=FIXGW
TargetCompID=BANZAI
SocketAcceptPort=10000
  
> camel-quickfix component in apache camel distribution
> -----------------------------------------------------
>
>                 Key: CAMEL-1350
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1350
>             Project: Apache Camel
>          Issue Type: New Feature
>         Environment: 	<properties>
> 		<camel-version>2.0-SNAPSHOT</camel-version>
> 		<fuse-version>2.x-fuse-SNAPSHOT</fuse-version>
> 		<activemq-version>5.2.0</activemq-version>
> 		<quickfix-version>1.3.3</quickfix-version>
> 		<mina-version>1.1.0</mina-version>
> 		<slf4j-version>1.5.6</slf4j-version>
> 	</properties>
>            Reporter: Charles Moulliard
>            Assignee: Hadrian Zbarcea
>             Fix For: 2.5.0
>
>         Attachments: camel-quickfix-2.zip, camel-quickfix.patch, camel-quickfix.zip, camel-quickfix.zip, QuickFixDataFormat.java, reportincident.quickfix.zip
>
>
> Hi,
> ATTENTION: Ignoring converter type: org.apache.camel.fix.FixConverter as a dependent class could not be found: java.lang.NoClassDefFoundError: biz/c24/io/api/data/DataType
> java.lang.NoClassDefFoundError: biz/c24/io/api/data/DataType
> 	at java.lang.Class.getDeclaredMethods0(Native Method)
> 	at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
> 	at java.lang.Class.getDeclaredMethods(Class.java:1791)
> 	at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.loadConverterMethods(AnnotationTypeConverterLoader.java:147)
> 	at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:78)
> 	at org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:260)
> 	at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:95)
> 	at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:71)
> 	at org.apache.camel.util.IntrospectionSupport.convert(IntrospectionSupport.java:263)
> 	at org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:221)
> 	at org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:188)
> 	at org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:213)
> 	at org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:63)
> 	at org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:33)
> 	at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:81)
> 	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:330)
> 	at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
> 	at org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:96)
> 	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
> 	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
> 	at org.apache.camel.model.FromType.resolveEndpoint(FromType.java:72)
> 	at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:81)
> 	at org.apache.camel.model.RouteType.addRoutes(RouteType.java:239)
> 	at org.apache.camel.model.RouteType.addRoutes(RouteType.java:86)
> 	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:661)
> 	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:651)
> 	at org.apache.camel.spring.SpringCamelContext.maybeDoStart(SpringCamelContext.java:166)
> 	at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:161)
> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
> 	at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:96)
> 	at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:115)
> 	at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
> 	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
> 	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
> 	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
> 	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
> 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:383)
> 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
> 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
> 	at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:232)
> 	at org.apache.camel.spring.Main.doStart(Main.java:186)
> 	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:49)
> 	at org.apache.camel.util.MainSupport.run(MainSupport.java:121)
> 	at org.apache.camel.util.MainSupport.run(MainSupport.java:299)
> 	at org.apache.camel.spring.Main.main(Main.java:98)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:396)
> 	at java.lang.Thread.run(Thread.java:619)
> The org.apache.camel.fix.FixConverter class uses proprietary classes : 
> import biz.c24.io.api.data.BooleanDataType;
> import biz.c24.io.api.data.CharDataType;
> import biz.c24.io.api.data.ComplexDataObject;
> import biz.c24.io.api.data.ComplexDataType;
> import biz.c24.io.api.data.DataType;
> import biz.c24.io.api.data.DateDataType;
> import biz.c24.io.api.data.Element;
> import biz.c24.io.api.data.IntDataType;
> import biz.c24.io.api.data.NumberDataType;
> import biz.c24.io.api.data.StringDataType;
> import biz.c24.io.api.presentation.TextualSource;
> import biz.c24.io.fix42.NewOrderSingleElement;
> Except if those classes are part of open source community but How can I use this component without Artix Data Service ?
> ex config :
> 		<route>
> 			<from uri="fixserver:banzai-to-camel.cfg" />
> 			<to uri="log:quickfix" />
> 		</route>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.