Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-50

Example code for sending messages is incorrect

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: None
    • Labels:
      None

      Description

      2 issues on the page http://www.quickfixj.org/quickfixj/usermanual/usage/sending_messages.html in the section "Most Type Safe... DO THIS!", the following code is shown:

      {{{
      quickfix.fix41.OrderCancelRequest message(
      new OrigClOrdID("123"),
      new ClOrdID("321"),
      new Symbol("LNUX"),
      new Side(Side.BUY));
      }}}

      This does not compile because the variable is not created correctly; it should be

      {{{
      quickfix.fix41.OrderCancelRequest message = new quickfix.fix41.OrderCancelRequest (
      new OrigClOrdID("123"),
      new ClOrdID("321"),
      new Symbol("LNUX"),
      new Side(Side.BUY));
      }}}

      Note the additional code "= new quickfix.fix41.OrderCancelRequest"

      Second issue:

      The line "Session.sendToTarget(message, "TW", "TARGET");" throws "SessionNotFound" which needs to be surrounded in a try..catch block

        Attachments

          Activity

            People

            • Assignee:
              markuskhouri Markus Khouri
              Reporter:
              markuskhouri Markus Khouri
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: