Citrus http server - connection refused

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Citrus http server - connection refused

gituser25
Hi,
I have configured citrus http server and trying to connect to reach this server from the client (my spring boot application) and getting connection refused exception. Can someone please help?

java.net.ConnectException: Connection refused (Connection refused)

String jsonInStringLookUp = ”{\”orgId\":\"1\",\"locationNbr\":\"59181\”}”;
HttpPost request = new HttpPost("http://localhost:8080/search/customer");
StringEntity input = new StringEntity(jsonInStringLookUp);
input.setContentType(CustomerConstants.CONTENT_TYPE_JSON);
request.setEntity(input);
HttpResponse response = httpClient.execute(request);
Reply | Threaded
Open this post in threaded view
|

Re: Citrus http server - connection refused

Christoph Deppisch
Administrator
I do not see the problem related to Citrus here. However I would suggest to use Spring's RestTemplate in your Spring Boot application. Also connection refused error is most of the time misplaced configuration of Http endpoint URLs. Please double check the port the server is running on.
Reply | Threaded
Open this post in threaded view
|

Re: Citrus http server - connection refused

gituser25
I got this working. will also look for spring rest template for http calls.

Thanks. This post can be closed.