I've ran a query on a hapi fhir database which has returned a paged result back to me. I'm using hapi base in java to actually do the search, as per the documentation here: http://hapifhir.io/doc_rest_client.html
Bundle bundle = client.search().forResource(Basic.class).returnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class).execute();
do {
for (Entry entry: bundle.getEntry())
System.out.println(entry.getFullUrl());
if (bundle.getLink(Bundle.LINK_NEXT) != null)
bundle = client.loadPage().next(bundle).execute();
else
bundle = null;
}
while (bundle != null);
The code runs as far as getting the first bundle, and prints out the urls as expected, however when it tries to execute the next bundle, I get a ConnectionException 'Connection refused: connect'.
The server still appears to be responsive however as I can rerun my program and have the exact same result returned.
Any idea why the connection would be being refused? I get a similar issue when I try to run it manually from postman.