<@U078Y59KC3B> How to pass pulsar broker url in pu...
# ask-ai
s
@RunLLM How to pass pulsar broker url in pulsar-client CLI command?
r
To pass the Pulsar broker URL in the
pulsar-client
CLI command, you need to specify the
--url
option followed by the broker service URL. This URL is used to connect the client to the Pulsar broker for producing or consuming messages. Here's an example of how to use it:
Copy code
bin/pulsar-client produce \
  --url pulsar://broker.example.com:6650 \
  -m "Hello Pulsar" \
  my-topic
In this example,
pulsar://broker.example.com:6650
is the broker service URL, and
my-topic
is the topic to which the message "Hello Pulsar" is being sent. You can replace
broker.example.com:6650
with the actual broker address and port you are using. Would you like more details on using the
pulsar-client
CLI? Sources: - https://pulsar.apache.org/docs/3.2.x/functions-deploy-localrun - https://pulsar.apache.org/docs/3.2.x/client-libraries-python-setup 👍 0 button 👎 1 button 💡 Hint: Mention @RunLLM in the thread for followups.
s
@RunLLM pulsar-client read command says --url is not a recognized option
r
It seems likely that the
pulsar-client
CLI tool does not support the
--url
option for the
read
command. Instead, the service URL is typically specified in the
client.conf
configuration file. You can set the
brokerServiceUrl
in this file to point to your desired broker. Here's an example of how to configure it: 1. Open the
client.conf
file located in the
conf
directory of your Pulsar installation. 2. Set the
brokerServiceUrl
to your broker's URL:
Copy code
brokerServiceUrl=pulsar://broker.example.com:6650
3. Use the
pulsar-client
read command without the
--url
option:
Copy code
bin/pulsar-client read my-topic -n 10
This command will read messages from
my-topic
using the broker URL specified in the
client.conf
file. Would you like more information on configuring the
pulsar-client
? Sources: - https://github.com/apache/pulsar/issues/23741 - https://github.com/apache/pulsar/blob/master/pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/PulsarClientTool.java 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
l
s
Thanks @Lari Hotari. I was trying to figure out where to pass the pulsar broker url. For the source file suggested by RunLLM, I figured out that command structure should be
Copy code
bin/pulsar-client \
  --url pulsar://broker.example.com:6650 \
  read \
  my-topic \
  -m earliest \
  -n 10
whereas I was trying to pass the --url option after
read
sub-command.