You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/08/16 12:34:54 UTC

[GitHub] maneeshmehra edited a comment on issue #277: Should decode not encode UTF-8 messages?

maneeshmehra edited a comment on issue #277: Should decode not encode UTF-8 messages?
URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/277#issuecomment-413530198
 
 
   I agree with Scott that there is no issue with the IBM Message Hub instance (Kafka) WRT corruption of messages. To confirm that was indeed the case, I created:
   
   1. A Java-based Kafka Producer class (com.ibm.kafka.KafkaProducerClient)
   2. A Java-based Kafka Consumer class(com.ibm.kafka.KafkaConsumerClient)
   
   The producer posts a message with some English and some non-English characters to a topic called Greeter. The consumer polls the same topic and prints out the message.
   
   Here is the output I am receiving from each:
   
   Producer:
   diamond:target mmehra$ java -cp KafkaClient-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.ibm.kafka.KafkaProducerClient
   SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
   SLF4J: Defaulting to no-operation (NOP) logger implementation
   SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
   **Producer: Posting message to topic: Greeter ==> {"greeting":"Howdy","user":"Malalažbeta"}
   Producer: Message posted to Partition: 0, Offset: 21**
   diamond:target mmehra$ 
   
   Consumer:
   diamond:target mmehra$ java -cp KafkaClient-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.ibm.kafka.KafkaConsumerClient
   SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
   SLF4J: Defaulting to no-operation (NOP) logger implementation
   SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
   Consumer: Polling For New Messages on Greeter topic...
   **Consumer: Received from topic => Partition: 0, Offset: 21, Message: {"greeting":"Howdy","user":"Malalažbeta"}**
   
   As you can see, the message is being received with the correct encoding from the IBM Message Hub topic. However, if I post the same message using the producer class and consume it via the IBM Cloud Function, the message is received as corrupted as described in the Slack conversation that Scott pointed to in his earlier comment.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services