Encoding problems in Camel Route - Component CJMS

One Star

Encoding problems in Camel Route - Component CJMS

Hello,
I have some encoding problems with a Camel Route developed with Talend ESB. I have no problems when I run job developed in Integration view.
My route purpose it to route and to consume an XML message sent in ActiveMQ (calling a sub-job).
I use these component :

CJMSConnectionFactory
CJMS
Output's CJMS message has encoding problems like that : <!]>
XML message input is encoded in UTF-8, and option Dfile.encoding in .ini is also defined in UTF-8. My browser is in UTF-8 too.
Do you know that problem ? Is there a particular encoding in ActiveMQ, or can we configure encoding options in cJMS component (I didn't find encoding options in AMQ documentation) ?
Thanks.

Employee

Re: Encoding problems in Camel Route - Component CJMS

Hi,
What kind of message are you producing?  Is it a TextMessage?  Can you disconnect all consumers and view the contents of this message in the ActiveMQ web console?
Do you only get the text "<!]>" from the message, or is there anything else?
One Star

Re: Encoding problems in Camel Route - Component CJMS

Thanks,
I just consume a XML message I created in Notepad++ (encoded UTF-8) to test it in local.
Steps :
1. Running Camel Route
2. Sending XML message in ActiveMQ
3. Message consumed by cJMS component
4. Seeing XML message in cLog
I don't see <!]> sorry :
So I suppose it exists an encoding overwiting but I don't know where. Thanks for any help you can give me !
Employee

Re: Encoding problems in Camel Route - Component CJMS

Output's CJMS message has encoding problems like that : <!]>

Can you explain the issue you're having some more?  I don't think I understand.  Where are you experiencing the issue?
One Star

Re: Encoding problems in Camel Route - Component CJMS

Hello,
To testing route purpose, I sent a XML message encoded in UTF-8 in AMQ ().
I click on "Send to" associated to my queue name and I copy my message in. Then I sent it.
Example :
<?xml version="1.0"?><response><method>ajoutAssure</method><cabinet>EUREXO</cabinet><assure><numero>43</numero><nom>Gérard MARTIN</nom><telMobile>1234</telMobile><telFixe>3456</telFixe><email>test@test.fr</email><adresse><libelle1>TEST21</libelle1><libelle2>TEST321111</libelle2><libelle3>éè@</libelle3><cp>31402</cp><ville>Toulouse2</ville><pays>France</pays></adresse></assure></response>


So, for instance the "libelle3" tag meet some issues with character encoding.
My route contains a CJMSConnectionFactory (to configure AMQ connection), and a CMJS component (which use the CJMSConnectionFactory component). The cJMS component's output message is linked to a cLog component.
In the log console, charcater appears with bad encoding.
Here, a log trace from activemq logs :
2015-02-23 09:32:23,802 | WARN  | org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte 72 in state 3 | org.eclipse.jetty.util.UrlEncoded | qtp708352791-48
2015-02-23 09:32:23,803 | WARN  | org.eclipse.jetty.util.Utf8Appendable$NotUtf8Exception: Not valid UTF8! byte E8 in state 3 | org.eclipse.jetty.util.UrlEncoded | qtp708352791-48


Thanks for any help.
Employee

Re: Encoding problems in Camel Route - Component CJMS

OK, thanks for the clarification.
This may be a JVM configuration problem.  When you run ActiveMQ, can you add this parameter?
-Dfile.encoding="UTF-8"

I found this suggestion here:
http://grokbase.com/t/activemq/users/12aqftncsk/problems-with-utf-8-encoding
One Star

Re: Encoding problems in Camel Route - Component CJMS

Thanks for reply bhough. I found this topic too Smiley Happy
I tried to add encoding parameter at the ActiveMQ,s execution, but the result is the same.
ActiveMQ version is 5.7.0.
Employee

Re: Encoding problems in Camel Route - Component CJMS

How about on the consumer JVM?  In the Run tab go to the "Advanced Settings" vertical tab and add the -Dfile.encoding="UTF-8".
One Star

Re: Encoding problems in Camel Route - Component CJMS

Thanks, but it doesn't work neither.
I guess there is an overwriting in ActiveMQ, or in Mediation's components. I don't have any encoding problems with Jobs running.
One Star

Re: Encoding problems in Camel Route - Component CJMS

I installed ActiveMQ version 5.10.0. It works with activemq.bat in "win64" folder.
I have any encoding problems.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read