Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Multi Hosts Service Url feature #279

Open
wyq985910398 opened this issue Nov 1, 2024 · 3 comments
Open

use Multi Hosts Service Url feature #279

wyq985910398 opened this issue Nov 1, 2024 · 3 comments

Comments

@wyq985910398
Copy link

wyq985910398 commented Nov 1, 2024

When I use the multi hosts service url feature, such as broker1 and broker2, if broker1 is stopped when the program is started, the program will not start. Can this be optimized? Java can start.

@Lanayx
Copy link
Member

Lanayx commented Nov 1, 2024

Can you please provide code example, so it will be clear what multi-address feature you mean?

@wyq985910398
Copy link
Author

wyq985910398 commented Nov 1, 2024

` const string serviceUrl = "pulsar://192.168.0.96:6501,192.168.0.96:6500";
const string subscriptionName = "my-subscription";
var topicName = "my-topic-003";
IConsumer<byte[]> consumer = null;
PularClient client = await new PulsarClientBuilder()
.ServiceUrl(serviceUrl)
.BuildAsync();

IProducer<byte[]> producer = null;
try
{
producer =await client.NewProducer()
.Topic(topicName)
.CreateAsync();
Console.WriteLine("temp");
}
catch (Exception ex)
{
Console.WriteLine("get Exception");
}`
The address contains two brokers. One of them is in a stopped state.
The feature is Multi Hosts Service Url.

@wyq985910398 wyq985910398 changed the title use multi-address feature use Multi Hosts Service Url feature Nov 1, 2024
@Lanayx
Copy link
Member

Lanayx commented Nov 1, 2024

@wyq985910398 I can't reproduce the issue locally. I've modified service url like that

let pulsarAddress = "pulsar://127.0.0.1:9950;127.0.0.1:6650" // first address doesn't exist

and basic test works after several reconnect retries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants