File tree Expand file tree Collapse file tree 2 files changed +2
-16
lines changed
tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Original file line number Diff line number Diff line change 23
23
import java .util .concurrent .TimeUnit ;
24
24
25
25
import org .apache .camel .kafkaconnector .common .PluginPathHelper ;
26
- import org .apache .camel .kafkaconnector .common .utils .NetworkUtils ;
27
26
import org .apache .camel .test .infra .kafka .services .KafkaService ;
28
27
import org .apache .kafka .connect .runtime .WorkerConfig ;
29
28
import org .apache .kafka .connect .util .clusters .EmbeddedConnectCluster ;
@@ -52,7 +51,7 @@ private void buildCluster() {
52
51
Map <String , String > workerProps = new HashMap <>();
53
52
workerProps .put (WorkerConfig .OFFSET_COMMIT_INTERVAL_MS_CONFIG , String .valueOf (OFFSET_COMMIT_INTERVAL_MS ));
54
53
55
- String address = NetworkUtils . getAddress ( "http" ) ;
54
+ String address = "http://localhost:9999" ;
56
55
LOG .info ("Using the following address for the listener configuration: {}" , address );
57
56
workerProps .put (WorkerConfig .LISTENERS_CONFIG , address );
58
57
Original file line number Diff line number Diff line change 19
19
import java .io .IOException ;
20
20
import java .net .ConnectException ;
21
21
import java .net .DatagramSocket ;
22
- import java .net .InetAddress ;
23
22
import java .net .InetSocketAddress ;
24
23
import java .net .ServerSocket ;
25
24
import java .net .Socket ;
@@ -33,7 +32,6 @@ public final class NetworkUtils {
33
32
public static final int DEFAULT_ENDING_PORT = 65535 ;
34
33
public static final int DEFAULT_STARTING_PORT = 49152 ;
35
34
public static int freeStartingPort = DEFAULT_STARTING_PORT ;
36
- private static String hostname ;
37
35
private static final Logger LOG = LoggerFactory .getLogger (NetworkUtils .class );
38
36
39
37
private NetworkUtils () {
@@ -120,18 +118,7 @@ public enum Protocol {
120
118
}
121
119
122
120
public static String getHostname () {
123
- if (hostname == null ) {
124
- try {
125
- hostname = InetAddress .getLocalHost ().getCanonicalHostName ();
126
- } catch (UnknownHostException e ) {
127
- LOG .warn ("Will default to 'localhost' because the code could not get the local hostname: {}" ,
128
- e .getMessage (), e );
129
-
130
- hostname = "localhost" ;
131
- }
132
- }
133
-
134
- return hostname ;
121
+ return "localhost" ;
135
122
}
136
123
137
124
public static String getAddress (String protocol ) {
You can’t perform that action at this time.
0 commit comments