assignment service + executor-base improvements #23
|
@ -5,6 +5,8 @@ import java.net.URI;
|
||||||
import java.net.http.HttpClient;
|
import java.net.http.HttpClient;
|
||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
|
@ -19,6 +21,8 @@ public class PublishTaskAssignedEventAdapter implements TaskAssignedEventPort {
|
||||||
|
|
||||||
String server = "http://127.0.0.1:8085";
|
String server = "http://127.0.0.1:8085";
|
||||||
|
|
||||||
|
Logger logger = Logger.getLogger(PublishTaskAssignedEventAdapter.class.getName());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void publishTaskAssignedEvent(TaskAssignedEvent event) {
|
public void publishTaskAssignedEvent(TaskAssignedEvent event) {
|
||||||
|
|
||||||
|
@ -37,7 +41,7 @@ public class PublishTaskAssignedEventAdapter implements TaskAssignedEventPort {
|
||||||
try {
|
try {
|
||||||
client.send(request, HttpResponse.BodyHandlers.ofString());
|
client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||||
} catch (IOException | InterruptedException e) {
|
} catch (IOException | InterruptedException e) {
|
||||||
e.printStackTrace();
|
logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||||
// Restore interrupted state...
|
// Restore interrupted state...
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user