Skip to content

Conversation

tcheeric
Copy link
Owner

Summary

  • add debug logs to SpringWebSocketClient send methods tracking relay and payload size
  • log WebSocket client closure lifecycle
  • improve retry failure logs with relay context and payload size

Testing

  • mvn -q verify (fails: Could not find a valid Docker environment)

https://chatgpt.com/codex/tasks/task_b_689928cdf5e48331ae12c376f6b1a8bc

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds comprehensive debug logging to WebSocket client operations to improve observability and debugging capabilities. The changes focus on tracking message size, relay context, and client lifecycle events.

  • Add debug logging for send operations with relay URL and message size tracking
  • Enhance error logging in recovery methods with more detailed context
  • Add logging around WebSocket client closure lifecycle

@@ -70,12 +77,15 @@ public List<String> recover(IOException ex, String json) throws IOException {
*/
@Recover
public List<String> recover(IOException ex, BaseMessage eventMessage) throws IOException {
log.error("Failed to send message after retries: {}", eventMessage, ex);
String json = eventMessage.encode();
log.error("Failed to send {} to relay {} after retries (size={} bytes)", eventMessage.getCommand(), relayUrl, json.length(), ex);
throw ex;
}
Copy link
Preview

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The eventMessage.encode() method is called again in the recovery method, which could be expensive if encoding is a heavy operation. Consider passing the already encoded JSON string to the recovery method instead of re-encoding.

Copilot uses AI. Check for mistakes.

@tcheeric tcheeric merged commit 11f5479 into develop Aug 10, 2025
1 check passed
@tcheeric tcheeric deleted the codex/add-logging-to-springwebsocketclient branch August 10, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant