Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2002-2013 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.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.messaging.core;
Operations for receiving messages from a destination.

Parameters:
<D> the type of destination to receive messages from
Author(s):
Mark Fisher
Rossen Stoyanchev
Since:
4.0
See also:
GenericMessagingTemplate
public interface MessageReceivingOperations<D> {

Receive a message from a default destination.

Returns:
the received message, possibly null if the message could not be received, for example due to a timeout
Receive a message from the given destination.

Parameters:
destination the target destination
Returns:
the received message, possibly null if the message could not be received, for example due to a timeout
	Message<?> receive(D destinationthrows MessagingException;

Receive a message from a default destination and convert its payload to the specified target class.

Parameters:
targetClass the target class to convert the payload to
Returns:
the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout
	<T> T receiveAndConvert(Class<T> targetClassthrows MessagingException;

Receive a message from the given destination and convert its payload to the specified target class.

Parameters:
destination the target destination
targetClass the target class to convert the payload to
Returns:
the converted payload of the reply message, possibly null if the message could not be received, for example due to a timeout
	<T> T receiveAndConvert(D destinationClass<T> targetClassthrows MessagingException;
New to GrepCode? Check out our FAQ X