You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2008/03/09 15:02:36 UTC

[jira] Created: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

camel-mina UDP protocol should have encoding configuration
----------------------------------------------------------

                 Key: CAMEL-381
                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-mina
    Affects Versions: 1.3.0
            Reporter: Claus Ibsen
            Priority: Minor


If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.

Currently it is fixed as:
{code}
                    encoder = Charset.defaultCharset().newEncoder();
{code}

It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

The title is a bit misleading. The encoding is for both *TCP* and *UDP* protocols.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

Okay it is a bit more tricky. The encoding now works for both TCP and UDP but *not* using the textline codec. 
It currently only works for the Mina default ObjectSerializationFactory. 

There is a type conversion problem with the textline codec. I am debugging into this.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41682#action_41682 ] 

Willem Jiang commented on CAMEL-381:
------------------------------------

Hi Claus,

I just found you used the String(byte[] bytes, Charset charset)  which is the new API  in JDK1.6 in the MinaEncodingTest , and I got the build fail message with JDK1.5.

So I changed the code to use the String(byte[] bytes, String charsetName)  API , which will make both JDK1.5 and JDK1.6 happy.

Regards,

Willem

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

TODO before resolving this issue:

Update wiki documentation for the component with this new encoding option.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

I got some prototype up and running at home. I will try to get a patch for it.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

The problem is MinaConverter

{code}
    public static String toString(ByteBuffer buffer) {
        return IOConverter.toString(toByteArray(buffer));
    }
{code}

It does not consider the encoding (eg UTF-8) when converting to string.


> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

In fact the TCP protocol has the same issue if using textline codec.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

UDP bytes with real UTF-8 chars is the only one failing now.
UDP string with real UTF-8 chars is OK.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

Should throw an IllegalArgumentException if configured with udp and textline=true as the textline is only supported for the TCP protocol.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

Willem,

Well spotted. I will remember to use JDK1.5 to be safe not to use some of the new API's in the JDK1.6. Then we are safe in the future.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Updated: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen updated CAMEL-381:
------------------------------

    Attachment: camel_381_patch_part2.txt

The patch for camel-mina

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Issue Comment Edited: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

davsclaus edited comment on CAMEL-381 at 3/12/08 10:10 PM:
-------------------------------------------------------------

UDP string with real UTF-8 chars is the only one failing now when doing assertMockEndpointSatisfied, since it will convert the receivedBody to a String using MinaConverter public static String toString(ByteBuffer buffer) and this one does not account for the encoding, so it does not know what encoding it should use.

We need something bigger here to support charset for type conversion from byte[] to String.

Notice that the MinaConsumer still works its only the mock endpoint that fails its assertions. So its just a minor issue. End users is not affected by this.

      was (Author: davsclaus):
    UDP bytes with real UTF-8 chars is the only one failing now.
UDP string with real UTF-8 chars is OK.
  
> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Closed: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen closed CAMEL-381.
-----------------------------

    Fix Version/s: 1.3.0
       Resolution: Fixed

Added documentation to the wiki component page.

See unit tests for samples how to use the encoding parameter.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 1.3.0
>
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Commented: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen commented on CAMEL-381:
-----------------------------------

Remember to update wiki docs with the new encoding parameter.

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Assigned: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Willem Jiang reassigned CAMEL-381:
----------------------------------

    Assignee: Willem Jiang

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt, camel_381_patch_part2.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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


[jira] Updated: (CAMEL-381) camel-mina UDP protocol should have encoding configuration

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

Claus Ibsen updated CAMEL-381:
------------------------------

    Attachment: camel_381_patch_part1.txt

This patch to camel-core is to add equal check for byte arrays for easier unit testing using the mock endpoints.

The test comples on my laptop:
Tests run: 294, Failures: 0, Errors: 0, Skipped: 0

> camel-mina UDP protocol should have encoding configuration
> ----------------------------------------------------------
>
>                 Key: CAMEL-381
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-381
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-mina
>    Affects Versions: 1.3.0
>            Reporter: Claus Ibsen
>            Priority: Minor
>         Attachments: camel_381_patch_part1.txt
>
>
> If sending string messages using a MinaProducer then the encoding configuration is not possible to configure.
> Currently it is fixed as:
> {code}
>                     encoder = Charset.defaultCharset().newEncoder();
> {code}
> It should be possible to configure this so we can have all those exotic kind of encodings to work.

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