Cracking FIXT1.1/FIX50 messages

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Cracking FIXT1.1/FIX50 messages

JonP
This is almost certainly a very basic question, but I've got an app that logs on and then sends a UserRequest type message to another test app, using FIXT1.1/FIX50. Inside the test app I'm trying to crack this message and it's always going to the default onMessage handler.

To be honest, I can't quite see why it would go anywhere else, because the only thing I can override if I extend the quickfix.MessageCracker class is the default handler.

However, if I extend quickfix.fixt50.MessageCracker (which does have suitable overrides), then I get a ClassCastException when I attempt to crack my incoming message.

So how do I crack my message?
Reply | Threaded
Open this post in threaded view
|

Re: Cracking FIXT1.1/FIX50 messages

Christoph John
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Hi,

what does your MessageCracker (which extends quickfix.MessageCracker) look like?
Which ClassCastException do you get?

Regards,
Chris.

On 02/09/15 17:21, JonP wrote:

> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
> This is almost certainly a very basic question, but I've got an app that logs
> on and then sends a UserRequest type message to another test app, using
> FIXT1.1/FIX50. Inside the test app I'm trying to crack this message and it's
> always going to the default onMessage handler.
>
> To be honest, I can't quite see why it would go anywhere else, because the
> only thing I can override if I extend the quickfix.MessageCracker class is
> the default handler.
>
> However, if I extend quickfix.fixt50.MessageCracker (which does have
> suitable overrides), then I get a ClassCastException when I attempt to crack
> my incoming message.
>
> So how do I crack my message?
>
>
>
> --
> View this message in context: http://quickfix-j.364392.n2.nabble.com/Cracking-FIXT1-1-FIX50-messages-tp7579185.html
> Sent from the QuickFIX/J mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Quickfixj-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users

--
Christoph John
Development & Support
Direct: +49 241 557080-28
Mailto:[hidden email]
       


http://www.macd.com <http://www.macd.com/>
----------------------------------------------------------------------------------------------------
       
----------------------------------------------------------------------------------------------------
MACD GmbH
Oppenhoffallee 103
D-52066 Aachen
Tel: +49 241 557080-0 | Fax: +49 241 557080-10
         Amtsgericht Aachen: HRB 8151
Ust.-Id: DE 813021663

Geschäftsführer: George Macdonald
----------------------------------------------------------------------------------------------------
       
----------------------------------------------------------------------------------------------------

take care of the environment - print only if necessary

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|

Re: Cracking FIXT1.1/FIX50 messages

JonP
Here's the relevant section of code:

        public void fromApp(Message message, SessionID sessionID)
        {
                log ("fromApp called, session id <" + sessionID.toString() + ">, message <" + message.toString() + ">");

                try
                {
                        crack(message, sessionID);
                }

                catch (UnsupportedMessageType e)
                {
                        log ("Unsupported type when trying to crack message, <" + e.getMessage() + ">");
                }

                catch (FieldNotFound e)
                {
                        log ("Field not found when trying to crack message, <" + e.getMessage() + ">");
                }

                catch (IncorrectTagValue e)
                {
                        log ("Incorrect tag value when trying to crack message, <" + e.getMessage() + ">");
                }
        }

        @Override
        public void onMessage(UserRequest message, SessionID sessionID)
        {
                processLogonRequest(message, sessionID);
        }

        @Override
        public void onMessage(UserResponse message, SessionID sessionID)
        {
                processLogonResponse(message, sessionID);
        }

        @Override
        public void onMessage(Message message, SessionID sessionID)
        {
                log ("Default message handler invoked");
        }

(the @Overrides have to go if I extend quickfix.MessageCracker rather than quickfix.fix50.MessageCracker.

And here's the stack trace for the error:

Caused by: java.lang.ClassCastException: quickfix.fixt11.Message cannot be cast to quickfix.fix50.Message
        at quickfix.fix50.MessageCracker.crack(MessageCracker.java:1345)
        at jpa.p1.aifix.AiFixMain.fromApp(AiFixMain.java:714)
Reply | Threaded
Open this post in threaded view
|

Re: Cracking FIXT1.1/FIX50 messages

JonP
Oh, and here's the message:

8=FIXT.1.19=13435=BE34=243=Y49=abcde52=20150902-13:25:50.02056=fghij122=20150902-13:25:47.8101129=1.7553=xxxx554=yyyy923=1924=110=077
Reply | Threaded
Open this post in threaded view
|

Re: Cracking FIXT1.1/FIX50 messages

JonP
Hmmm. Looks like there's actually a problem with the message itself. I've fixed that and it seems to be cracking fine now. Thanks for your help anyway.
Reply | Threaded
Open this post in threaded view
|

Re: Cracking FIXT1.1/FIX50 messages

Chavez, Jose-3
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Sometimes it can also be the message factory you are passing into QFJ on startup. Are you using the DefaultMessageFactory? Or your own?

- Jose

-----Original Message-----
From: JonP [mailto:[hidden email]]
Sent: Wednesday, September 02, 2015 11:23 AM
To: [hidden email]
Subject: Re: [Quickfixj-users] Cracking FIXT1.1/FIX50 messages

QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Hmmm. Looks like there's actually a problem with the message itself. I've fixed that and it seems to be cracking fine now. Thanks for your help anyway.



--
View this message in context: http://quickfix-j.364392.n2.nabble.com/Cracking-FIXT1-1-FIX50-messages-tp7579185p7579189.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Reply | Threaded
Open this post in threaded view
|

Re: Cracking FIXT1.1/FIX50 messages

JonP
Yes, that was exactly what the problem was. For some reason I'd had some issue with the DefaultMessageFactory and I'd switched to using my own. I went back to DefaultMessageFactory and everything now works fine.