wolfstudy commented on issue #623:
URL: 
https://github.com/apache/pulsar-client-go/issues/623#issuecomment-928768695


   And the java demo as follows:
   
   ```
   public static void main(String[] args) throws PulsarClientException {
           PulsarClient client = PulsarClient.builder()
                   .serviceUrl("pulsar://localhost:6650")
                   .build();
   
           final String topic = "test-topic-002";
           final int msgCount = 100000;
   
           Producer<byte[]> producer = client.newProducer()
                   .topic(topic)
                   .create();
           for (int i = 0; i < msgCount; i++) {
               String value = "new msg No." + i;
               MessageId msgId = producer.newMessage()
                       .value(value.getBytes())
                       .send();
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException exception) {
                   exception.printStackTrace();
               }
               System.out.println("===>>> produce msg id:" + new 
String(msgId.toString()) + ", value:" + value);
           }
           producer.flush();
   }
   ```


-- 
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