You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/12/12 15:56:18 UTC
[GitHub] [pulsar] reswqa opened a new pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
reswqa opened a new pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939
Fix #8832
### Modifications
Make AvroSchema's clone method consider custom reader and writer.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] sijie merged pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
sijie merged pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939#discussion_r541878983
##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java
##########
@@ -858,8 +861,40 @@ public void asyncClose(org.apache.bookkeeper.client.AsyncCallback.CloseCallback
consumer.close();
}
+
+ @Test
+ public void testAvroSchemaProducerConsumerWithSpecifiedReaderAndWriter() throws PulsarClientException {
+ final String topicName = "persistent://my-property/my-ns/my-topic1";
+ TestMessageObject object = new TestMessageObject();
+ SchemaReader<TestMessageObject> reader = Mockito.mock(SchemaReader.class);
+ SchemaWriter<TestMessageObject> writer = Mockito.mock(SchemaWriter.class);
+ Mockito.when(reader.read(Mockito.any(byte[].class), Mockito.any(byte[].class))).thenReturn(object);
+ Mockito.when(writer.write(Mockito.any(TestMessageObject.class))).thenReturn("fake data".getBytes(StandardCharsets.UTF_8));
+ SchemaDefinition<TestMessageObject> schemaDefinition = new SchemaDefinitionBuilderImpl<TestMessageObject>()
+ .withPojo(TestMessageObject.class)
+ .withSchemaReader(reader)
+ .withSchemaWriter(writer)
+ .build();
+ Schema<TestMessageObject> schema = Schema.AVRO(schemaDefinition);
+ PulsarClient client = PulsarClient.builder()
Review comment:
Please close this PulsarClient
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] reswqa commented on pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
reswqa commented on pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939#issuecomment-743965315
/pulsarbot run-failure-checks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] reswqa commented on pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
reswqa commented on pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939#issuecomment-743974928
/pulsarbot run-failure-checks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] reswqa commented on a change in pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
reswqa commented on a change in pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939#discussion_r541881136
##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java
##########
@@ -858,8 +861,40 @@ public void asyncClose(org.apache.bookkeeper.client.AsyncCallback.CloseCallback
consumer.close();
}
+
+ @Test
+ public void testAvroSchemaProducerConsumerWithSpecifiedReaderAndWriter() throws PulsarClientException {
+ final String topicName = "persistent://my-property/my-ns/my-topic1";
+ TestMessageObject object = new TestMessageObject();
+ SchemaReader<TestMessageObject> reader = Mockito.mock(SchemaReader.class);
+ SchemaWriter<TestMessageObject> writer = Mockito.mock(SchemaWriter.class);
+ Mockito.when(reader.read(Mockito.any(byte[].class), Mockito.any(byte[].class))).thenReturn(object);
+ Mockito.when(writer.write(Mockito.any(TestMessageObject.class))).thenReturn("fake data".getBytes(StandardCharsets.UTF_8));
+ SchemaDefinition<TestMessageObject> schemaDefinition = new SchemaDefinitionBuilderImpl<TestMessageObject>()
+ .withPojo(TestMessageObject.class)
+ .withSchemaReader(reader)
+ .withSchemaWriter(writer)
+ .build();
+ Schema<TestMessageObject> schema = Schema.AVRO(schemaDefinition);
+ PulsarClient client = PulsarClient.builder()
Review comment:
Thank you, it has been fixed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] reswqa commented on pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
reswqa commented on pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939#issuecomment-743992913
/pulsarbot run-failure-checks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939#issuecomment-748917325
remove tag release 2.6.3 since it depends on https://github.com/apache/pulsar/pull/8464. There many conflicts with branch-2.6.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on pull request #8939: [ISSUE 8832] Avro custom schema not working in consumer
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #8939:
URL: https://github.com/apache/pulsar/pull/8939#issuecomment-744094433
@congbobo184 Could you please help take a loot at this PR?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org