diff --git a/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java b/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java index f64ff0bf49..9069468b11 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/MessageChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +22,13 @@ package org.springframework.messaging; * @author Mark Fisher * @since 4.0 */ +@FunctionalInterface public interface MessageChannel { /** * Constant for sending a message without a prescribed timeout. */ - public static final long INDEFINITE_TIMEOUT = -1; + long INDEFINITE_TIMEOUT = -1; /** @@ -40,7 +41,9 @@ public interface MessageChannel { * @param message the message to send * @return whether or not the message was sent */ - boolean send(Message message); + default boolean send(Message message) { + return send(message, INDEFINITE_TIMEOUT); + } /** * Send a message, blocking until either the message is accepted or the