Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2588#discussion_r173635798
--- Diff:
external/storm-eventhubs/src/main/java/org/apache/storm/eventhubs/format/StringEventDataScheme.java
---
@@ -15,60 +15,43 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
-package org.apache.storm.eventhubs.spout;
+package org.apache.storm.eventhubs.format;
-import com.microsoft.azure.eventhubs.EventData;
-import org.apache.storm.tuple.Fields;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
+import org.apache.storm.eventhubs.core.EventHubMessage;
+import org.apache.storm.eventhubs.core.FieldConstants;
+import org.apache.storm.tuple.Fields;
/**
- * An Event Data Scheme which deserializes message payload into the raw
bytes.
- *
+ * An Event Data Scheme which deserializes message payload into the
Strings. No
+ * encoding is assumed. The receiver will need to handle parsing of the
string
+ * data in appropriate encoding.
+ * <p>
* The resulting tuple would contain three items, the first being the
message
* bytes, and the second a map of properties that include metadata, which
can be
* used to determine who processes the message, and how it is
processed.The third is
* the system properties which exposes information like enqueue-time,
offset and
- * sequence number
+ * sequence number.
*/
-public class BinaryEventDataScheme implements IEventDataScheme {
+public class StringEventDataScheme implements IEventDataScheme {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public List<Object> deserialize(EventHubMessage eventHubMessage) {
+ final List<Object> fieldContents = new ArrayList<Object>();
+ final String messageData = new
String(eventHubMessage.getContent());
--- End diff --
This should probably use a specific charset
---