Hi Hiranya, I feel like I'm making some progress but it's still not quite there. I placed the <property> mediator you suggested immediately before the <send> mediator in the <out> sequence and it now appears that the message is getting to the FIX logic. But then it stops with the following NPE:
2009-07-16 13:48:50,422 [-] [SynapseWorker-1] INFO LogMediator GMMR-OrderRep-GenFIX = GMMR-OrderRep about to send the following to FIX session... 2009-07-16 13:48:50,422 [-] [SynapseWorker-1] INFO LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:FF264C84B81C2AD6688038696696933553359936, Direction: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body> <message xmlns:cfl="http://www.harts.com/cfl" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" counter="1" inSession="FIX.4.2:OPTMED->BROKER"> <header> <field id="8">FIX.4.2</field> <field id="35">8</field> <field id="49">OPTMED</field> <field id="52">20090716-08:37:51.051</field> <field id="56">BROKER</field> </header> <body> <field id="37">ON-1-1247751471617-2</field> <field id="11">ClientOrd1</field> <field id="38">1000</field> <field id="40">2</field> <field id="54">1</field> <field id="55">MSQ</field> <field id="59">0</field> <field id="60">20090716-08:37:51.051</field> </body> </message> </soapenv:Body></soapenv:Envelope> 2009-07-16 13:48:50,452 [-] [SynapseWorker-1] ERROR Axis2Sender Unexpected error during sending message out java.lang.NullPointerException at org.apache.synapse.transport.fix.FIXOutgoingMessageHandler.sendToTarget(FIXOutgoingMessageHandler.java:122) at org.apache.synapse.transport.fix.FIXOutgoingMessageHandler.sendMessage(FIXOutgoingMessageHandler.java:82) at org.apache.synapse.transport.fix.FIXTransportSender.sendUsingEPR(FIXTransportSender.java:309) at org.apache.synapse.transport.fix.FIXTransportSender.sendMessage(FIXTransportSender.java:136) at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:190) at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:174) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:343) at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:56) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:176) at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:194) at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59) at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:75) at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60) at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:115) at org.apache.synapse.mediators.MediatorWorker.run(MediatorWorker.java:69) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) at java.lang.Thread.run(Thread.java:595) Do you think this is because I'm using Synapse-TRUNK from about a month ago? Or should this functionality be in that version? Thanks, Bill Hiranya Jayathilaka-3 wrote: > > Hi Bill, > My bad! I forgot to mention that you need to set the service name property > using the property mediator, before calling the send mediator. Sorry about > that. Use the property mediator as follows in your out sequence before the > send mediator. > > <property name="transport.fix.ServiceName" value="FIXProxy" > scope="axis2-client"/> > > The FIX transport sender requires that message context carries service > information. If the message was received by the FIX transport listener it > will set the service information. But in your scenario the message arrives > over HTTP so we need to explicitly set it at service configuration level. > > Thanks, > Hiranya > > On Thu, Jul 16, 2009 at 7:33 PM, PrgTrdr <[email protected]> wrote: > >> >> Thanks Hiranya, >> >> I believe you are offering the correct solution, however I'm still not >> getting it right. >> >> 1. At your suggestion, I inserted the following <send> mediator in my >> <out> >> sequence. >> <send> >> <endpoint> >> <address >> >> uri="fix://localhost:9876?BeginString=FIX.4.2&SenderCompID=OPTMED&TargetCompID=BROKER"/> >> </endpoint> >> </send> >> >> 2. When it reaches this point, Synapse gives the exception, "Unable to >> find >> a valid service for the message". Here is the log output: >> 2009-07-16 09:37:51,343 [-] [SynapseWorker-2] INFO LogMediator To: >> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , >> MessageID: urn:uuid:5191E37439E3958F4479756836588468614536389, Direction: >> response, Envelope: <?xml version='1.0' >> encoding='utf-8'?><soapenv:Envelope >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body> >> <message xmlns:cfl="http://www.harts.com/cfl" >> xmlns:fn="http://www.w3.org/2005/02/xpath-functions" counter="1" >> inSession="FIX.4.2:OPTMED->BROKER"> >> <header> >> <field id="8">FIX.4.2</field> >> <field id="35">8</field> >> <field id="49">OPTMED</field> >> <field id="52">20090716-08:37:30.030</field> >> <field id="56">BROKER</field> >> </header> >> <body> >> <field id="37" /> >> <field id="11" /> >> <field id="38">1000</field> >> <field id="40">2</field> >> <field id="54">1</field> >> <field id="55" /> >> <field id="59">3</field> >> <field id="60">20090716-08:37:30.030</field> >> </body> >> </message> >> </soapenv:Body></soapenv:Envelope> >> 2009-07-16 09:37:51,413 [-] [SynapseWorker-2] ERROR Axis2Sender >> Unexpected >> error during sending message out >> org.apache.axis2.AxisFault: Unable to find a valid service for the >> message >> at >> org.apache.synapse.transport.fix.FIXUtils.getServiceName(FIXUtils.java:655) >> at >> >> org.apache.synapse.transport.fix.FIXTransportSender.sendMessage(FIXTransportSender.java:103) >> at >> >> org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112) >> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435) >> at >> >> org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.send(DynamicAxisOperation.java:190) >> at >> >> org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:174) >> at >> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) >> at >> >> org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:343) >> at >> org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:56) >> at >> >> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:176) >> at >> >> org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:194) >> at >> org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59) >> at >> >> org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:75) >> at >> >> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60) >> at >> >> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:115) >> at >> org.apache.synapse.mediators.MediatorWorker.run(MediatorWorker.java:69) >> at >> >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651) >> at >> >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676) >> at java.lang.Thread.run(Thread.java:595) >> 2009-07-16 09:37:51,423 [-] [SynapseWorker-2] WARN EndpointContext >> Endpoint >> : AnonymousEndpoint will be marked SUSPENDED as it failed >> >> 3. Here is the FIXProxy definition (very similar to Sample 259): >> <endpoint name="test-system" > <!-- Must use TCPMon as proxy --> >> <address uri="http://localhost:2001/api/v1" format="soap11" /> >> </endpoint> >> >> <proxy name="FIXProxy" transports="fix"> >> <target endpoint="test-system" > >> <inSequence> >> <log level="full" /> >> . >> . >> . >> <!-- Translate the message --> >> <xslt key="xslt-key-req" /> >> <log level="full" /> >> >> </inSequence> >> >> <outSequence> >> <log level="full" /> >> >> <sequence key="HandleResponse1" /> >> <sequence key="HandleResponse2" /> >> >> <log level="full" /> >> <send /> >> >> </outSequence> >> </target> >> >> <parameter >> >> name="transport.fix.AcceptorConfigURL">file:repository/conf/OptMed/resources/fix/FIX-OptMed.cfg</parameter> >> <parameter name="transport.fix.AcceptorMessageStore">file</parameter> >> <parameter name="transport.fix.AcceptorLogFactory">file</parameter> >> </proxy> >> >> 4. Here is the FIX configuration file FIX-OptMed.cfg referenced in the >> FIXProxy definition (very similar to default Sample setup): >> [default] >> FileStorePath=logs/fix/OptMed >> FileLogPath=logs/fix/OptMed >> ConnectionType=acceptor >> StartTime=00:00:00 >> EndTime=00:00:00 >> HeartBtInt=30 >> ValidOrderTypes=1,2,F >> SenderCompID=OPTMED >> TargetCompID=BROKER >> UseDataDictionary=Y >> DefaultMarketPrice=12.30 >> ResetOnLogon=Y >> ResetOnDisconnect=Y >> >> [session] >> BeginString=FIX.4.2 >> SocketAcceptPort=9876 >> >> DataDictionary=C:\Apache\Synapse-Snapshot\repository\conf\OptMed\resources\fix\DD-OptMed42.xml >> >> Thanks again for your help. >> Bill >> >> >> Hiranya Jayathilaka-3 wrote: >> > >> > Hi Bill, >> > >> > On Thu, Jul 16, 2009 at 6:17 PM, PrgTrdr <[email protected]> wrote: >> > >> >> >> >> After more tracing and analysis I think I understand what is happening >> >> but >> >> I >> >> still need a little help. >> >> >> >> My synapse.xml configuration includes an inline task whose purpose is >> to >> >> periodically poll the WS for market data messages. When such a >> message >> >> comes in it is received as an "asynchronous response message" and is >> >> passed >> >> to the Main Sequence. My problem is how to get it passed to the FIX >> >> session--either directly through the proxy or indirectly through the >> Main >> >> sequence. >> > >> > >> > I believe what you want to do is to pass the market data messages >> coming >> > from the WS to the FIX acceptor session on which your proxy service is >> > listening on. Is that correct? In that case you could address the FIX >> > session by giving it an EPR and then use the send mediator to forward >> > messages to the FIX session. For an example let's say your FIX session >> has >> > following parameters. >> > >> > BeginString=FIX.4.4 >> > SenderCompID=SYNAPSE >> > TargetCompID=MyComp >> > >> > Then we can use the following EPR to address the FIX session: >> > >> > >> fix://localhost:9876?BeginString=FIX.4.4&SenderCompID=SYNAPSE&TargetCompID=MyComp >> > >> > >> > Replace the port number (9876) with the actual port number on which >> your >> > FIX >> > proxy service is listening on. Now in the main sequence you can use the >> > send >> > mediator as follows to forward messages to the FIX session. >> > >> > <send> >> > <endpoint> >> > <address >> > >> uri="fix://localhost:9876?BeginString=FIX.4.4&SenderCompID=SYNAPSE&TargetCompID=MyComp >> > "/> >> > </endpoint> >> > </send> >> > >> > Does this achive your goal? >> > >> > Also please note that the initial FIX transport implementation did not >> > support scenarios as complex as this. The enhancements required to run >> > this >> > scenario was done very recently and hence this will work only on >> Synapse >> > snapshot builds until we get the next release out. On earlier releases >> you >> > will get an NPE if you try to do this. >> > >> > Thanks, >> > Hiranya >> > >> > >> > >> >> >> >> Is there a different way to structure the task definition so Synapse >> >> knows >> >> to route the response to the FIX proxy? (I saw a couple of Nabble >> >> messages >> >> about a 'ProxyInjector' mediator but I don't know if that is the >> answer >> >> to >> >> this problem (if it exists).) >> >> >> >> Here's the task definition: >> >> <task class="org.apache.synapse.startup.tasks.MessageInjector" >> >> name="GetMarketMessages"> >> >> <property name="to" value="http://localhost:2001/api/v1"/> >> >> <property name="format" value="soap11"/> >> >> <property name="soapAction" value=""/> >> >> <property name="message"> >> >> <GetMarketMessages xmlns="http://www.harts.com/cfl" /> >> >> </property> >> >> <trigger interval="10"/> >> >> </task> >> >> >> >> Here's the log output: >> >> 2009-07-13 14:52:25,409 [-] [HttpClientWorker-15] DEBUG >> >> SynapseCallbackReceiver Synapse received an asynchronous response >> message >> >> 2009-07-13 14:52:25,539 [-] [HttpClientWorker-15] DEBUG >> >> SynapseCallbackReceiver Received To: null >> >> 2009-07-13 14:52:25,609 [-] [HttpClientWorker-15] DEBUG >> >> SynapseCallbackReceiver SOAPAction: >> >> 2009-07-13 14:52:25,609 [-] [HttpClientWorker-15] DEBUG >> >> SynapseCallbackReceiver WSA-Action: >> >> 2009-07-13 14:52:25,689 [-] [HttpClientWorker-15] DEBUG >> >> SynapseCallbackReceiver Body : >> >> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope >> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> >> xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soapenv:Body> >> >> <cfl:GetMarketMessagesResponse xmlns:cfl="http://www.harts.com/cfl"> >> >> <cfl:GetMarketMessagesResponseData >> >> sessionID="A29A1D4D85AEF15F46D3229414619591" /> >> >> </cfl:GetMarketMessagesResponse> >> >> </soapenv:Body></soapenv:Envelope> >> >> 2009-07-13 14:52:25,860 [-] [HttpClientWorker-15] DEBUG >> >> Axis2SynapseEnvironment Injecting MessageContext >> >> 2009-07-13 14:52:25,860 [-] [HttpClientWorker-15] DEBUG >> >> Axis2SynapseEnvironment Using Main Sequence for injected message >> >> 2009-07-13 14:52:25,920 [-] [HttpClientWorker-15] DEBUG >> SequenceMediator >> >> Start : Sequence <main> >> >> 2009-07-13 14:52:25,950 [-] [HttpClientWorker-15] DEBUG >> SequenceMediator >> >> Sequence <SequenceMediator> :: mediate() >> >> 2009-07-13 14:52:26,050 [-] [HttpClientWorker-15] DEBUG InMediator >> Start >> >> : >> >> In mediator >> >> 2009-07-13 14:52:26,050 [-] [HttpClientWorker-15] DEBUG InMediator >> >> Current >> >> message is a response - skipping child mediators >> >> 2009-07-13 14:52:26,080 [-] [HttpClientWorker-15] DEBUG InMediator End >> : >> >> In >> >> mediator >> >> 2009-07-13 14:52:26,080 [-] [HttpClientWorker-15] DEBUG OutMediator >> Start >> >> : >> >> Out mediator >> >> 2009-07-13 14:52:26,140 [-] [HttpClientWorker-15] DEBUG OutMediator >> >> Current >> >> message is outgoing - executing child mediators >> >> 2009-07-13 14:52:26,170 [-] [HttpClientWorker-15] DEBUG OutMediator >> >> Sequence >> >> <OutMediator> :: mediate() >> >> 2009-07-13 14:52:26,170 [-] [HttpClientWorker-15] DEBUG FilterMediator >> >> Start >> >> : Filter mediator >> >> 2009-07-13 14:52:26,280 [-] [HttpClientWorker-15] DEBUG FilterMediator >> >> XPath >> >> expression : >> >> boolean(//cfl:LoginResponse/cfl:LoginResponseData/@sessionID) >> >> evaluates to false and no else path - skipping child mediators >> >> 2009-07-13 14:52:26,350 [-] [HttpClientWorker-15] DEBUG FilterMediator >> >> End >> >> : >> >> Filter mediator >> >> 2009-07-13 14:52:26,451 [-] [HttpClientWorker-15] DEBUG FilterMediator >> >> Start >> >> : Filter mediator >> >> 2009-07-13 14:52:26,481 [-] [HttpClientWorker-15] DEBUG FilterMediator >> >> XPath >> >> expression : boolean(//cfl:GetMarketMessagesResponseData) evaluates to >> >> true >> >> - executing child mediators >> >> 2009-07-13 14:52:26,531 [-] [HttpClientWorker-15] DEBUG FilterMediator >> >> Sequence <FilterMediator> :: mediate() >> >> . >> >> . >> >> . >> >> 2009-07-13 14:52:26,851 [-] [HttpClientWorker-15] DEBUG FilterMediator >> >> End >> >> : >> >> Filter mediator >> >> 2009-07-13 14:52:26,851 [-] [HttpClientWorker-15] DEBUG OutMediator >> End >> : >> >> Out mediator >> >> 2009-07-13 14:52:26,931 [-] [HttpClientWorker-15] DEBUG >> SequenceMediator >> >> End >> >> : Sequence <main> >> >> >> >> Appreciate any help... >> >> Thanks, >> >> Bill >> >> >> >> >> >> Hiranya Jayathilaka-3 wrote: >> >> > >> >> > Hi Bill, >> >> > >> >> > On Thu, Jul 16, 2009 at 2:40 AM, PrgTrdr <[email protected]> wrote: >> >> > >> >> >> >> >> >> I have cloned Sample 259 to implement a use case where a FIX client >> >> >> communicates with a Web Service. The system is working well as far >> as >> >> 1) >> >> >> establishing the FIX session from the client to Synapse, 2) Logon, >> >> >> 3)Sending >> >> >> a New Order message, 4)performing an XSLT to create a WS request, >> >> >> 5)sending >> >> >> the Request to the WS, 6)receiving back a Response from the WS, >> >> >> 7)performing >> >> >> an XSLT to convert the SOAP response to an XML-encapsulated FIX >> >> message. >> >> >> But then the response message never flows back to the FIX transport >> (I >> >> >> can >> >> >> tell by examining the QuickFIX/J logs). >> >> >> >> >> >> I am receiving (and converting) the WS Response message in a >> standard >> >> >> "<out>" sequence. At the end I placed >> >> >> >> >> >> <send> >> >> >> <endpoint key="FIXProxy"/> >> >> >> </send> >> >> >> >> >> >> to see if that would make it work, but the message doesn't go out >> to >> >> FIX, >> >> >> nor does it show up in the FIXProxy <outSequence> (I put some log >> >> >> mediators >> >> >> in there to trace activity). >> >> >> >> >> >> Sample 259 is one-way only (FIX->SOAP). Can someone give me an >> idea >> >> >> about >> >> >> what needs to be done to make this two-way? Perhaps changes to the >> >> >> FIXProxy >> >> >> configuration? >> >> > >> >> > >> >> > How about placing an empty <send/> element in the <outSequence> of >> your >> >> > proxy service? I think that should do the trick. Anyway please send >> in >> >> > your >> >> > full Synapse configuration for us to get a clear idea of the >> scenario. >> >> > >> >> > Thanks, >> >> > Hiranya >> >> > >> >> > >> >> >> >> >> >> Thanks, >> >> >> Bill >> >> >> -- >> >> >> View this message in context: >> >> >> >> >> >> http://www.nabble.com/HTTP--%3E-FIX-Response-Handling-tp24505424p24505424.html >> >> >> Sent from the Synapse - User mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> > >> >> > >> >> > -- >> >> > Hiranya Jayathilaka >> >> > Software Engineer; >> >> > WSO2 Inc.; http://wso2.org >> >> > E-mail: [email protected]; Mobile: +94 77 633 3491 >> >> > Blog: http://techfeast-hiranya.blogspot.com >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/HTTP--%3E-FIX-Response-Handling-tp24505424p24515672.html >> >> Sent from the Synapse - User mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> > -- >> > Hiranya Jayathilaka >> > Software Engineer; >> > WSO2 Inc.; http://wso2.org >> > E-mail: [email protected]; Mobile: +94 77 633 3491 >> > Blog: http://techfeast-hiranya.blogspot.com >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/HTTP--%3E-FIX-Response-Handling-tp24505424p24517040.html >> Sent from the Synapse - User mailing list archive at Nabble.com. >> >> > > > -- > Hiranya Jayathilaka > Software Engineer; > WSO2 Inc.; http://wso2.org > E-mail: [email protected]; Mobile: +94 77 633 3491 > Blog: http://techfeast-hiranya.blogspot.com > > -- View this message in context: http://www.nabble.com/HTTP--%3E-FIX-Response-Handling-tp24505424p24521522.html Sent from the Synapse - User mailing list archive at Nabble.com.
