From 757c3f925ce5c216a733d3a7150e844a320c1e2b Mon Sep 17 00:00:00 2001 From: wpl <1269223860@qq.com> Date: Thu, 17 Jan 2019 15:36:47 +0800 Subject: [PATCH] Issue #3373: RemotelyClosedException when running SampleProducer *Motivation* Fixes #3373 The service url in SampleProducer is wrong. *Modification* Fix the service url in SampleProducer and SampleConsumer. --- .../java/org/apache/pulsar/client/tutorial/SampleConsumer.java | 2 +- .../java/org/apache/pulsar/client/tutorial/SampleProducer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleConsumer.java b/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleConsumer.java index 0b3ffdf798b21..93ee4d22c050a 100644 --- a/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleConsumer.java +++ b/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleConsumer.java @@ -26,7 +26,7 @@ public class SampleConsumer { public static void main(String[] args) throws PulsarClientException, InterruptedException { - PulsarClient pulsarClient = PulsarClient.builder().serviceUrl("http://localhost:8080").build(); + PulsarClient pulsarClient = PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build(); Consumer consumer = pulsarClient.newConsumer() // .topic("persistent://my-tenant/my-ns/my-topic") // diff --git a/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleProducer.java b/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleProducer.java index 467d34cd5b45e..28997bdf07a3f 100644 --- a/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleProducer.java +++ b/pulsar-client/src/test/java/org/apache/pulsar/client/tutorial/SampleProducer.java @@ -26,7 +26,7 @@ public class SampleProducer { public static void main(String[] args) throws PulsarClientException, InterruptedException, IOException { - PulsarClient client = PulsarClient.builder().serviceUrl("http://localhost:6650").build(); + PulsarClient client = PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build(); Producer producer = client.newProducer().topic("persistent://my-tenant/my-ns/my-topic").create();