lshift/diffa — Issue #32: Scan client does not update itself at runtime
Author: 0x6e6562
Created: 2012-02-08 15:05:02+00:00
State: open

The REST client does not appear to get initialized properly when you change the URL of a scan endpoint. So for example:

* You are running the demo participant running on localhost:19293
* Go to the settings page, change the port of the scan URL for one endpoint to a bogus value
* Save the setting
* Go to the status page and run a scan for the pair that points to the bogus endpoint

You will find that the scan completes successfully (which is wrong). Then if you restart the agent, and try to run a scan, you get the following (expected) error:

```
15:00:05.953 [akka:event-driven:dispatcher:global-4] ERROR PairActor:400 - Upstream scan failed: diffa/WEB-1
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149) ~[jersey-client-1.10.jar:1.10]
at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:81) ~[jersey-client-1.10.jar:1.10]
at com.sun.jersey.api.client.Client.handle(Client.java:648) ~[jersey-client-1.10.jar:1.10]
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670) ~[jersey-client-1.10.jar:1.10]
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) ~[jersey-client-1.10.jar:1.10]
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:503) ~[jersey-client-1.10.jar:1.10]
at net.lshift.diffa.client.ScanningParticipantRestClient.scan(ScanningParticipantRestClient.scala:60) ~[diffa-client-support-1.2.2-SNAPSHOT.jar:na]

```

It would appear that the lifecycle of the REST stub is buggy.