Removed OK's from logging, not needed
This commit is contained in:
@@ -8,7 +8,6 @@ import org.apache.logging.log4j.LogManager;
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.http.HttpClient;
|
import java.net.http.HttpClient;
|
||||||
import java.net.http.WebSocket;
|
import java.net.http.WebSocket;
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionStage;
|
import java.util.concurrent.CompletionStage;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
@@ -19,10 +18,10 @@ public class Main {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
logger.info("Node up. - OK");
|
logger.info("Node started");
|
||||||
EntityManager em = Data.getEntityManager();
|
EntityManager em = Data.getEntityManager();
|
||||||
|
|
||||||
logger.info("Connected to database: << symphony >> - OK");
|
logger.info("Connected to database: << symphony >>");
|
||||||
em.close();
|
em.close();
|
||||||
|
|
||||||
try (HttpClient client = HttpClient.newHttpClient()) {
|
try (HttpClient client = HttpClient.newHttpClient()) {
|
||||||
@@ -33,7 +32,7 @@ public class Main {
|
|||||||
public CompletionStage<?> onText(WebSocket webSocket, CharSequence data, boolean last) {
|
public CompletionStage<?> onText(WebSocket webSocket, CharSequence data, boolean last) {
|
||||||
try {
|
try {
|
||||||
int nodeCount = Integer.parseInt(data.toString());
|
int nodeCount = Integer.parseInt(data.toString());
|
||||||
logger.info("Acknowledged nodes: {} - OK", nodeCount);
|
logger.info("Acknowledged nodes: {}", nodeCount);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
logger.error("Received invalid node count: {}", data);
|
logger.error("Received invalid node count: {}", data);
|
||||||
}
|
}
|
||||||
@@ -42,7 +41,7 @@ public class Main {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onOpen(WebSocket webSocket) {
|
public void onOpen(WebSocket webSocket) {
|
||||||
logger.info("Successfully registered to Discovery - OK");
|
logger.info("Successfully registered to Discovery");
|
||||||
waitForConnection.countDown();
|
waitForConnection.countDown();
|
||||||
WebSocket.Listener.super.onOpen(webSocket);
|
WebSocket.Listener.super.onOpen(webSocket);
|
||||||
}
|
}
|
||||||
@@ -66,7 +65,7 @@ public class Main {
|
|||||||
waitForConnection.await();
|
waitForConnection.await();
|
||||||
Thread.currentThread().join();
|
Thread.currentThread().join();
|
||||||
} finally {
|
} finally {
|
||||||
ws.sendClose(WebSocket.NORMAL_CLOSURE, "Node shutting down. - OK").join();
|
ws.sendClose(WebSocket.NORMAL_CLOSURE, "Node shutting down").join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ public class Main {
|
|||||||
|
|
||||||
JavalinConfig.setup(app);
|
JavalinConfig.setup(app);
|
||||||
|
|
||||||
logger.info("Discovery service up and running. - OK");
|
logger.info("Discovery service up and running");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ public class BrokerConnector {
|
|||||||
Channel channel = connection.createChannel()) {
|
Channel channel = connection.createChannel()) {
|
||||||
|
|
||||||
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
|
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
|
||||||
logger.info("Connected to RabbitMQ and queue declared. - OK");
|
logger.info("Connected to RabbitMQ and queue declared");
|
||||||
|
|
||||||
DeliverCallback deliverCallback = (consumerTag, delivery) -> channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
|
DeliverCallback deliverCallback = (consumerTag, delivery) -> channel.basicAck(delivery.getEnvelope().getDeliveryTag(), false);
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ public class BrokerConnector {
|
|||||||
CountDownLatch latch = new CountDownLatch(1);
|
CountDownLatch latch = new CountDownLatch(1);
|
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
logger.info("Shutdown signal received. - OK");
|
logger.info("Shutdown signal received");
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
boolean success = connectToRabbitMQ(latch);
|
boolean success = connectToRabbitMQ(latch);
|
||||||
logger.info("Success: {} - OK", success);
|
logger.info("Success: {}", success);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean connectToRabbitMQ(CountDownLatch latch) {
|
private static boolean connectToRabbitMQ(CountDownLatch latch) {
|
||||||
@@ -46,7 +46,7 @@ public class BrokerConnector {
|
|||||||
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor()) {
|
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor()) {
|
||||||
|
|
||||||
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
|
channel.queueDeclare(QUEUE_NAME, false, false, false, null);
|
||||||
logger.info("Connected to RabbitMQ and queue declared. - OK");
|
logger.info("Connected to RabbitMQ and queue declared");
|
||||||
|
|
||||||
scheduler.scheduleAtFixedRate(() -> {
|
scheduler.scheduleAtFixedRate(() -> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user