BewareMyPower commented on code in PR #930:
URL: https://github.com/apache/pulsar-client-go/pull/930#discussion_r1060259323
##########
pulsar/table_view_test.go:
##########
@@ -78,3 +78,67 @@ func TestTableView(t *testing.T) {
assert.Equal(t, valuePrefix+k, *(v.(*string)))
}
}
+
+func TestPublishNilValue(t *testing.T) {
+ client, err := NewClient(ClientOptions{
+ URL: lookupURL,
+ })
+
+ assert.NoError(t, err)
+ defer client.Close()
+
+ topic := newTopicName()
+ schema := NewStringSchema(nil)
+
+ // create producer
+ producer, err := client.CreateProducer(ProducerOptions{
+ Topic: topic,
+ Schema: schema,
+ })
+ assert.NoError(t, err)
+ defer producer.Close()
+
+ // create table view
+ v := ""
+ tv, err := client.CreateTableView(TableViewOptions{
+ Topic: topic,
+ Schema: schema,
+ SchemaValueType: reflect.TypeOf(&v),
+ })
+ assert.NoError(t, err)
+ defer tv.Close()
+
+ _, err = producer.Send(context.Background(), &ProducerMessage{
+ Key: "key-1",
+ Value: "value-1",
+ })
+ assert.NoError(t, err)
+
+ for tv.Size() < 1 {
+ time.Sleep(time.Second * 1)
+ }
Review Comment:
Is there any way to avoid the sleep call like the `awaitility` in Java? If
not, we can write a util function.
--
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]