You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Pablo Venini (JIRA)" <ji...@apache.org> on 2011/07/28 23:46:09 UTC

[jira] [Created] (CAMEL-4278) Additional methods added to example QuickfixConverters

Additional methods added to example QuickfixConverters
------------------------------------------------------

                 Key: CAMEL-4278
                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
             Project: Camel
          Issue Type: Improvement
            Reporter: Pablo Venini
            Priority: Trivial


The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073572#comment-13073572 ] 

Pablo Venini commented on CAMEL-4278:
-------------------------------------

The byte[] returned by Bindy ends with CR+LF. Quickfix's parser choked on that so I had to remove them. Thinking about it, this was tested in a Win environment; in Linux I should have to remove only one char.

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt, patchfile_1.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pablo Venini updated CAMEL-4278:
--------------------------------

    Attachment:     (was: patchfile.txt)

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_1.txt, patchfile_2.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pablo Venini updated CAMEL-4278:
--------------------------------

    Attachment: patchfile.txt

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pablo Venini updated CAMEL-4278:
--------------------------------

    Attachment: patchfile_3.txt

Cleaner (I hope) code
                
> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_3.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pablo Venini updated CAMEL-4278:
--------------------------------

    Attachment: patchfile_2.txt

Scans for any type of linefeed and adjusts the trimming accordingly.

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_1.txt, patchfile_2.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073582#comment-13073582 ] 

Claus Ibsen commented on CAMEL-4278:
------------------------------------

Okay would be better to skip ending chars if they are any kind of line feeds. Do you mind working on a refined patch? 

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt, patchfile_1.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078956#comment-13078956 ] 

Claus Ibsen edited comment on CAMEL-4278 at 8/3/11 7:43 PM:
------------------------------------------------------------

Pablo I wonder if the scan logic could be made a bit simpler, something like

pseudo code
{code}
if X endsWith("\n") || x endsWith("\r") {
  X = X subString(0, x.length-1); // mac or unix line terminators
else if X endWith("\r\n") 
  X = X subString(0, x.length-2);  // windows is dual afair
}
{code}


      was (Author: davsclaus):
    Pablo I wonder if the scan logic could be made a bit simpler, something like

{code}
if X endsWith("\n") || x endsWith("\r") {
  X = X subString(0, x.length-1); // mac or unix line terminators
else if X endWith("\r\n") 
  X = X subString(0, x.length-2);  // windows is dual afair
}


  
> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_2.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pablo Venini updated CAMEL-4278:
--------------------------------

    Attachment:     (was: patchfile_2.txt)
    
> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_3.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073584#comment-13073584 ] 

Claus Ibsen commented on CAMEL-4278:
------------------------------------

And add comment in the code why you need this so ppl know its on purpose

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt, patchfile_1.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pablo Venini updated CAMEL-4278:
--------------------------------

    Attachment: patchfile_1.txt

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt, patchfile_1.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072894#comment-13072894 ] 

Claus Ibsen commented on CAMEL-4278:
------------------------------------

Why do you do a copy from 0 to length - 2 ?

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt, patchfile_1.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Bengt Rodehav (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072710#comment-13072710 ] 

Bengt Rodehav commented on CAMEL-4278:
--------------------------------------

The character set "UTF-8" is hardcoded in the patch. Isn't there a way to get the correct character set from Camel? I believe one can change the character set by setting properties on the exchange (or is it in the message?)

Also, in the patch you first use "UTF8" and then "UTF-8". I think the latter is correct.

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pablo Venini updated CAMEL-4278:
--------------------------------

    Attachment:     (was: patchfile_1.txt)

> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_2.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080009#comment-13080009 ] 

Pablo Venini commented on CAMEL-4278:
-------------------------------------

Claus:
      I wanted to avoid the overhead of creating another temporary String object so I worked directly on the byte array (these methods would be invoked for every application message processed by the engine). Anyway I shot myself in the foot because in my application Exchange.CHARSET_NAME is NULL and the try/catch always get triggered. In this regard I'm in doubt about what to do; the FIX standard specifies an ASCII 7-bit charset so I don't know if the byte [] -> String conversion wouldn't have to be hardcoded to use that encoding or if I should set that encoding in the Exchange properties (from the application).


> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_2.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Pablo Venini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072848#comment-13072848 ] 

Pablo Venini commented on CAMEL-4278:
-------------------------------------

Modified the methods to obtain charset from exchange properties. Thanks for the head-up.



> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile.txt, patchfile_1.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078956#comment-13078956 ] 

Claus Ibsen commented on CAMEL-4278:
------------------------------------

Pablo I wonder if the scan logic could be made a bit simpler, something like

{code}
if X endsWith("\n") || x endsWith("\r") {
  X = X subString(0, x.length-1); // mac or unix line terminators
else if X endWith("\r\n") 
  X = X subString(0, x.length-2);  // windows is dual afair
}



> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Priority: Trivial
>         Attachments: patchfile_2.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CAMEL-4278) Additional methods added to example QuickfixConverters

Posted by "Claus Ibsen (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-4278.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9.0
         Assignee: Claus Ibsen

Thanks for the patch.

I polished it slightly. Would be good with unit tests though as we have some unit tests for the existing type converters.
                
> Additional methods added to example QuickfixConverters
> ------------------------------------------------------
>
>                 Key: CAMEL-4278
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4278
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pablo Venini
>            Assignee: Claus Ibsen
>            Priority: Trivial
>             Fix For: 2.9.0
>
>         Attachments: patchfile_3.txt
>
>
> The example QuickfixConverters converter class didn't have methods to convert from a byte array to a Message and from Message to InputStream. That prevented me from marshalling/unmarshalling Quickfix messages with Bindy. Enclosed is a patch with the needed methods.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira