GitHub user ShubhamMaddhashiya-bidgely added a comment to the discussion: Tips 
- Workaround incorrect DNS resolutions on MacOS

Hi @Somnium99 were you able to resolve the issue, I'm also getting similar 
error while running pulsar client.
```
Jun 20, 2023 2:12:30 PM 
org.apache.pulsar.shade.io.netty.resolver.dns.DnsServerAddressStreamProviders 
<clinit>
WARNING: Can not find 
org.apache.pulsar.shade.io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider
 in the classpath, fallback to system defaults. This may result in incorrect 
DNS resolutions on MacOS.

```
My OS: Ventura MacOS (intel)
IDE: IntelliJ

POM file:
```
 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <pulsar.version>2.10.3</pulsar.version>
  </properties>


  <dependencies>
    <dependency>
      <groupId>org.apache.pulsar</groupId>
      <artifactId>pulsar-client</artifactId>
      <version>${pulsar.version}</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-resolver-dns-native-macos</artifactId>
      <scope>runtime</scope>
      <classifier>osx-x86_64</classifier>
      <version>4.1.72.Final</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
```
Main method:
```java

import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.Schema;

/**
 * Hello world!
 *
 */
public class App {
    public static void main( String[] args )  {
        try {
            PulsarClient client = 
PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build();
            Producer<String> stringProducer = client.newProducer(Schema.STRING)
                    .topic("my-topic")
                    .create();
            stringProducer.send("My message");
            stringProducer.close();
        }
        catch (PulsarClientException e) {
            e.printStackTrace();
        }
    }
}

```

GitHub link: 
https://github.com/apache/pulsar/discussions/17067#discussioncomment-6227930

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to