diff --git a/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java index 852fefe9a7..65af926ff3 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java @@ -42,11 +42,4 @@ public interface MessageHandler { */ void handleMessage(Message> message) throws MessagingException; - /* - * TODO: exceptions - * @throws org.springframework.integration.MessageRejectedException if the handler doesn't accept the message - * @throws org.springframework.integration.MessageHandlingException when something fails during the handling - * @throws org.springframework.integration.MessageDeliveryException when this handler failed to deliver the - */ - } diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageBodyMethodArgumentResolver.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageBodyMethodArgumentResolver.java index 2cae5cd560..5babb256ac 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageBodyMethodArgumentResolver.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageBodyMethodArgumentResolver.java @@ -25,7 +25,7 @@ import org.springframework.util.Assert; /** - * TODO + * A resolver for extracting the body of a message. * *
This {@link HandlerMethodArgumentResolver} should be ordered last as it supports all
* types and does not require the {@link MessageBody} annotation.
@@ -62,7 +62,6 @@ public class MessageBodyMethodArgumentResolver implements HandlerMethodArgumentR
return message.getPayload();
}
else {
- // TODO: use content-type header
return this.converter.fromMessage(message, targetClass);
}
}
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/InvocableHandlerMethod.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/InvocableHandlerMethod.java
index 92b2237c26..6ae945fed8 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/handler/method/InvocableHandlerMethod.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/method/InvocableHandlerMethod.java
@@ -94,7 +94,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
}
/**
- * TODO
+ * Invoke the method with the given message.
*
* @exception Exception raised if no suitable argument resolver can be found, or the
* method raised an exception
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AnnotationMethodMessageHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AnnotationMethodMessageHandler.java
index 05365f1bf4..599e9ece73 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AnnotationMethodMessageHandler.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AnnotationMethodMessageHandler.java
@@ -339,8 +339,7 @@ public class AnnotationMethodMessageHandler implements MessageHandler, Applicati
invokeExceptionHandler(message, handlerMethod, ex);
}
catch (Throwable ex) {
- // TODO
- ex.printStackTrace();
+ logger.error("Error while processing message " + message, ex);
}
}
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
index b723eaf0b8..f39c43fe66 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
@@ -255,7 +255,6 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
return null;
}
String[] rawValues = StringUtils.commaDelimitedListToStringArray(rawValue);
- // TODO assertions
return new long[] { Long.valueOf(rawValues[0]), Long.valueOf(rawValues[1])};
}
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompMessageConverter.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompMessageConverter.java
index 222f9d65e4..a410c615c5 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompMessageConverter.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompMessageConverter.java
@@ -73,7 +73,6 @@ public class StompMessageConverter {
String headerContent = new String(byteContent, 0, payloadIndex, STOMP_CHARSET);
Parser parser = new Parser(headerContent);
- // TODO: validate command and whether a payload is allowed
StompCommand command = StompCommand.valueOf(parser.nextToken(LF).trim());
Assert.notNull(command, "No command found");
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompProtocolHandler.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompProtocolHandler.java
index 5be1963e41..de20592538 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompProtocolHandler.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompProtocolHandler.java
@@ -99,9 +99,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
String payload = ((TextMessage)webSocketMessage).getPayload();
Message> message = this.stompMessageConverter.toMessage(payload);
- // TODO: validate size limits
- // http://stomp.github.io/stomp-specification-1.2.html#Size_Limits
-
if (logger.isTraceEnabled()) {
logger.trace("Message " + message);
}
@@ -124,10 +121,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
logger.error("Terminating STOMP session due to failure to send message: ", t);
sendErrorMessage(session, t);
}
-
- // TODO: send RECEIPT message if incoming message has "receipt" header
- // http://stomp.github.io/stomp-specification-1.2.html#Header_receipt
-
}
catch (Throwable error) {
sendErrorMessage(session, error);
@@ -149,13 +142,11 @@ public class StompProtocolHandler implements SubProtocolHandler {
}
if (StompCommand.MESSAGE.equals(headers.getCommand()) && (headers.getSubscriptionId() == null)) {
- // TODO: failed message delivery mechanism
logger.error("Ignoring message, no subscriptionId header: " + message);
return;
}
if (!(message.getPayload() instanceof byte[])) {
- // TODO: failed message delivery mechanism
logger.error("Ignoring message, expected byte[] content: " + message);
return;
}
@@ -197,7 +188,7 @@ public class StompProtocolHandler implements SubProtocolHandler {
else {
throw new StompConversionException("Unsupported version '" + acceptVersions + "'");
}
- connectedHeaders.setHeartbeat(0,0); // TODO
+ connectedHeaders.setHeartbeat(0,0);
Principal principal = session.getPrincipal();
if (principal != null) {
@@ -210,8 +201,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
}
}
- // TODO: security
-
Message> connectedMessage = MessageBuilder.withPayloadAndHeaders(new byte[0], connectedHeaders).build();
byte[] bytes = this.stompMessageConverter.fromMessage(connectedMessage);
session.sendMessage(new TextMessage(new String(bytes, Charset.forName("UTF-8"))));
diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java
index 8793d1950d..ab53dc4d40 100644
--- a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java
+++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java
@@ -188,7 +188,6 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
stopBrokerAndAwait();
- // TODO:
// 1st message will see ERROR frame (broker shutdown is not but should be detected)
// 2nd message will be queued (a side effect of CONNECT/CONNECTED-buffering, likely to be removed)
// Finish this once the above changes are made.
diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java
index ff2466926b..9c1bfa7eb0 100644
--- a/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java
+++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java
@@ -89,10 +89,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
configBuidler.preferredSubprotocols(protocols);
try {
- // TODO: do not block
Endpoint endpoint = new StandardWebSocketHandlerAdapter(webSocketHandler, session);
this.webSocketContainer.connectToServer(endpoint, configBuidler.build(), uri);
-
return session;
}
catch (Exception e) {
diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java
index 5a9f0d74e5..c1f1c0f733 100644
--- a/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java
+++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java
@@ -20,7 +20,9 @@ import java.net.URI;
import java.security.Principal;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.Future;
+import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.springframework.context.SmartLifecycle;
@@ -158,8 +160,8 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma
JettyWebSocketHandlerAdapter listener = new JettyWebSocketHandlerAdapter(wsHandler, wsSession);
try {
- // TODO: do not block
- this.client.connect(listener, uri, request).get();
+ Future