Github user SreeramGarlapati commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2026#discussion_r107483782
  
    --- Diff: 
external/storm-eventhubs/src/main/java/org/apache/storm/eventhubs/spout/StringEventDataScheme.java
 ---
    @@ -44,21 +40,23 @@
     public class StringEventDataScheme implements IEventDataScheme {
     
       private static final long serialVersionUID = 1L;
    +  private static final Logger logger = 
LoggerFactory.getLogger(StringEventDataScheme.class);
     
       @Override
    -  public List<Object> deserialize(Message message) {
    +  public List<Object> deserialize(EventData eventData) {
         final List<Object> fieldContents = new ArrayList<Object>();
    -
    -    for (Section section : message.getPayload()) {
    -      if (section instanceof Data) {
    -        Data data = (Data) section;
    -        fieldContents.add(new String(data.getValue().getArray()));
    -      } else if (section instanceof AmqpValue) {
    -        AmqpValue amqpValue = (AmqpValue) section;
    -        fieldContents.add(amqpValue.getValue().toString());
    +    String messageData = "";
    +    if(eventData.getBytes()!=null)
    +      messageData = new String (eventData.getBytes());
    +    else if(eventData.getObject()!=null){
    +      try{
    +        messageData = new 
String(Serializedeserializeutil.serialize(eventData.getObject()),Charset.defaultCharset());
    --- End diff --
    
    >new 
String(Serializedeserializeutil.serialize(eventData.getObject()),Charset.defaultCharset());
 [](start = 22, length = 95)
    
    eventData.getObject() would return java type of the corresponding Amqp 
object (if there is no direct java type mapping available - you would see a 
proton-j type here).
    If the type is a primitive data type - simply return .tostring().
    else - follow the serialization approach.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to