[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-13 Thread Pierre-Henry Brasseur (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17458507#comment-17458507
 ] 

Pierre-Henry Brasseur commented on ARTEMIS-3598:


Hello [~gtully] ,

 

does the following fix good to integrate in a new version of activemq-cpp ?

(see src/main/activemq/util/MarshallingSupport.cpp in attachment)

It is working on my side, but I'm not aware of any possible impact this could 
be.

[^MarshallingSupport.cpp]

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0, 2.17.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Artemis - example cpp.png, Artemis - example-1.png, 
> Artemis - example.png, Artemis - stack traces  from cpp client.png, Artemis - 
> stack traces.png, MarshallingSupport.cpp, Re Question about charset supported 
> by Artemis.msg, main.c, verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-09 Thread Gary Tully (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17456566#comment-17456566
 ] 

Gary Tully commented on ARTEMIS-3598:
-

ok, I have reproduced, \337 is the key, that needs two bytes of unicode, but it 
is being encoded in one, the length of the encoding is off. Java does it 
correctly but the cpp client does not.

the culprit seems to be:

[https://github.com/apache/activemq-cpp/blob/master/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.cpp#L148]

 

and:

[https://github.com/apache/activemq-cpp/blob/master/activemq-cpp/src/main/activemq/util/MarshallingSupport.cpp#L84]

 

it does not support multi byte strings. I see some hints in further methods 
that it was considered, but it is not done!

I guess that is the place for a fix if it is necessary.

feel free to peek at: 
[https://github.com/apache/activemq/blob/main/activemq-client/src/main/java/org/apache/activemq/util/MarshallingSupport.java#L299]

for inspiration.

 

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0, 2.17.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Artemis - example cpp.png, Artemis - example-1.png, 
> Artemis - example.png, Artemis - stack traces  from cpp client.png, Artemis - 
> stack traces.png, Re Question about charset supported by Artemis.msg, main.c, 
> verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-09 Thread Pierre-Henry Brasseur (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17456374#comment-17456374
 ] 

Pierre-Henry Brasseur commented on ARTEMIS-3598:


I did test with same main.cpp from Activemq-cpp-library-3.9.5, with the 
following code updated:
{code:java}
            for (int ix = 0; ix < numMessages; ++ix) {
                if (ix == 4) {
                    text = (string) "Test Message  \u00DF";
                } else if (ix == 5) {
                    text = (string) "Test Message  \337";
                }
                std::auto_ptr 
message(session->createTextMessage(text));
                message->setIntProperty("Integer", ix);
                printf("Sent message #%d from thread %s : %s\n", ix + 1, 
threadIdStr.c_str(), text.c_str());
                producer->send(message.get());
            }
 {code}
and my test is still KO wit hsame stack trace on server side.

See attachments. !Artemis - example cpp.png!

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0, 2.17.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Artemis - example cpp.png, Artemis - example-1.png, 
> Artemis - example.png, Artemis - stack traces  from cpp client.png, Artemis - 
> stack traces.png, Re Question about charset supported by Artemis.msg, main.c, 
> verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-09 Thread Gary Tully (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17456294#comment-17456294
 ] 

Gary Tully commented on ARTEMIS-3598:
-

unless there is some problem with the c wrapper over the cpp library. Artemis 
looks to be doing the right thing.

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0, 2.17.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Artemis - example-1.png, Artemis - example.png, Artemis 
> - stack traces.png, Re Question about charset supported by Artemis.msg, 
> main.c, verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-09 Thread Gary Tully (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17456293#comment-17456293
 ] 

Gary Tully commented on ARTEMIS-3598:
-

{code:java}
gtullys-MBP:examples gtully$ ./example 
=
Starting the example:
-
Sent message #1 from thread 140701938767368
Sent message #2 from thread 140701938767368
Sent message #3 from thread 140701938767368
Sent message #4 from thread 140701938767368
Sent message #5 from thread 140701938767368
Sent message #6 from thread 140701938767368
Sent message #7 from thread 140701938767368
Sent message #8 from thread 140701938767368
Sent message #9 from thread 140701938767368
Sent message #10 from thread 140701938767368
Message #1 Received: Hello world! from thread 140701938767368
Message #2 Received: Hello world! from thread 140701938767368
Message #3 Received: Hello world! from thread 140701938767368
Message #4 Received: Hello world! from thread 140701938767368
Message #5 Received: Test Message  ß
Message #6 Received: Test Message  DF
Message #7 Received: Hello world! from thread 140701938767368
Message #8 Received: Hello world! from thread 140701938767368
Message #9 Received: Hello world! from thread 140701938767368
Message #10 Received: Hello world! from thread 140701938767368
Time to completion = 0.237 seconds.
-
Finished with the example.
=
gtullys-MBP:examples gtully$  {code}

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0, 2.17.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Artemis - example-1.png, Artemis - example.png, Artemis 
> - stack traces.png, Re Question about charset supported by Artemis.msg, 
> main.c, verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-09 Thread Gary Tully (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17456267#comment-17456267
 ] 

Gary Tully commented on ARTEMIS-3598:
-

There are a few differences, I am using trunk/main activemq-artemis and 
trunk/main activemq-cpp with the main.cpp modified to include your changes from 
main.c

Could this be a c vs cpp compiler thing? Or are you using a different client 
altogether?

{code}
diff --git a/activemq-cpp/src/examples/main.cpp 
b/activemq-cpp/src/examples/main.cpp
index 9cc513a8..1c2c71ea 100644
--- a/activemq-cpp/src/examples/main.cpp
+++ b/activemq-cpp/src/examples/main.cpp
@@ -117,9 +117,16 @@ public:
 string threadIdStr = 
Long::toString(Thread::currentThread()->getId());
 
 // Create a messages
-string text = (string) "Hello world! from thread " + threadIdStr;
+//string text = (string) "Hello world! from thread " + threadIdStr;
 
 for (int ix = 0; ix < numMessages; ++ix) {
+
+string text = (string) "Hello world! from thread " + threadIdStr;
+if (ix == 4) {
+   text = (string) "Test Message  \u00DF";
+} else if (ix == 5) {
+   text = (string) "Test Message  �DF";
+}
 std::auto_ptr 
message(session->createTextMessage(text));
 message->setIntProperty("Integer", ix);
 printf("Sent message #%d from thread %s\n", ix + 1, 
threadIdStr.c_str());
@@ -381,7 +388,7 @@ int main(int argc AMQCPP_UNUSED, char* argv[] 
AMQCPP_UNUSED) {
 //
 bool useTopics = true;
 bool sessionTransacted = false;
-int numMessages = 2000;
+int numMessages = 10;
 
 long long startTime = System::currentTimeMillis();
 
gtullys-MBP:activemq-cpp gtully$ git remote -v
origin  https://gitbox.apache.org/repos/asf/activemq-cpp.git (fetch)
origin  https://gitbox.apache.org/repos/asf/activemq-cpp.git (push)
{code}

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0, 2.17.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Artemis - example-1.png, Artemis - example.png, Artemis 
> - stack traces.png, Re Question about charset supported by Artemis.msg, 
> main.c, verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-09 Thread Pierre-Henry Brasseur (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17456233#comment-17456233
 ] 

Pierre-Henry Brasseur commented on ARTEMIS-3598:


I did  test with Artemis 2.19 installed on a RH8.2 and I have same error.

See the stack trace and trace for the execution of the example program (main.c) 
in attachment. !Artemis - example.png!

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0, 2.17.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Artemis - example.png, Artemis - stack traces.png, Re 
> Question about charset supported by Artemis.msg, main.c, verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-08 Thread Pierre-Henry Brasseur (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17456216#comment-17456216
 ] 

Pierre-Henry Brasseur commented on ARTEMIS-3598:


Hello,

 

it is working with ActiveMQ 5.x, but did you test my example main.c with 
Artemis 2.17?

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Gary Tully
>Priority: Major
> Attachments: Re Question about charset supported by Artemis.msg, 
> main.c, verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-08 Thread Gary Tully (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17455902#comment-17455902
 ] 

Gary Tully commented on ARTEMIS-3598:
-

[~phbrasseur] I cannot reproduce this, with main in java and with a local build 
of main cms. It works ok. See the attached little java unit test that verifies 
from the main line. When that worked I build cms and ran your example main.c 
and it works too. Not sure what you are seeing but maybe verify with the latest 
5.19.0 or main.

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Clebert Suconic
>Priority: Major
> Attachments: Re Question about charset supported by Artemis.msg, 
> main.c, verifyUtf.patch
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-06 Thread Pierre-Henry Brasseur (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17453875#comment-17453875
 ] 

Pierre-Henry Brasseur commented on ARTEMIS-3598:


Hello,
you will find in attachment the main.c as example, it is a example program 
coming from the fusemqc-client installation package.
I modified it to test with the german special character "ß" send a first time 
in UTF-8 code with success and a second time in ISO-8859-15 which failed.

 

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Clebert Suconic
>Priority: Major
> Attachments: Re Question about charset supported by Artemis.msg, 
> main.c
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARTEMIS-3598) Sending text message non-UTF-8 containing special characters from OpenWire

2021-12-03 Thread Gary Tully (Jira)


[ 
https://issues.apache.org/jira/browse/ARTEMIS-3598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17453079#comment-17453079
 ] 

Gary Tully commented on ARTEMIS-3598:
-

I will try and peek at this in the next few days, if you have some sample code 
to demonstrate it would be a great help. I am pondering the original assertion 
that messages from the webconsole work ok even with the encoding error.
In any event, I will have to brush up on encodings, it is the sort of thing 
that is very easy to forget :-)

> Sending text message non-UTF-8 containing special characters from OpenWire 
> ---
>
> Key: ARTEMIS-3598
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3598
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: ActiveMQ-Artemis-Native, OpenWire
>Affects Versions: 2.16.0
>Reporter: Pierre-Henry Brasseur
>Assignee: Clebert Suconic
>Priority: Major
> Attachments: Re Question about charset supported by Artemis.msg
>
>
> When a text message non-UTF-8 (ISO-8859-15) containing special characters is 
> sent from OpenWire, this raised an exception 
> :"java.io.UTFDataFormatException" which is not correctly handle and prevent 
> the sending of the text message.
> See email from ActiveMQ Community in attachment for more details.
> [^Re Question about charset supported by Artemis.msg] 
>  
> This was working with previous ActiveMQ version (v5.15.9).
>  
> Identified during following test :
> Text message sent from a C program using the Fuse ActiveMQ-Client C library 
> to Artemis v2.16.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)