Oliverwqcwrw commented on code in PR #291:
URL: https://github.com/apache/rocketmq-connect/pull/291#discussion_r973685036


##########
connectors/rocketmq-connect-activemq/src/main/java/org/apache/rocketmq/connect/activemq/connector/ActivemqSourceTask.java:
##########
@@ -131,11 +118,52 @@ public ByteBuffer getMessageContent(Message message) 
throws JMSException {
             while ((i = streamMessage.readBytes(by)) != -1) {
                 bis.write(by, 0, i);
             }
-            data = bis.toByteArray();
+            data = bis.toString();
         } else {
             // The exception is printed and does not need to be written as a 
DataConnectException
             throw new RuntimeException("message type exception");
         }
-        return ByteBuffer.wrap(data);
+        return data;
+    }
+
+    private ConnectRecord message2ConnectRecord(Message message) throws 
JMSException {
+        Schema schema = SchemaBuilder.struct().name("activemq").build();
+        final List<Field> fields = buildFields();
+        schema.setFields(fields);
+        return new ConnectRecord(buildRecordPartition(),
+            buildRecordOffset(),
+            System.currentTimeMillis(),
+            schema,
+            buildPayLoad(fields, message, schema));
+    }
+
+    private RecordOffset buildRecordOffset()  {
+        Map<String, Long> offsetMap = new HashMap<>();
+        RecordOffset recordOffset = new RecordOffset(offsetMap);

Review Comment:
   I have  solved it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to