Merge branch '5.2.x'

This commit is contained in:
Sam Brannen
2020-08-10 11:36:19 +02:00
2 changed files with 14 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2005 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -20,11 +20,12 @@ import javax.jms.JMSException;
import javax.jms.Message; import javax.jms.Message;
/** /**
* To be used with JmsTemplate's send method that convert an object to a message. * To be used with JmsTemplate's send method that converts an object to a message.
* It allows for further modification of the message after it has been processed
* by the converter. This is useful for setting of JMS Header and Properties.
* *
* <p>This often as an anonymous class within a method implementation. * <p>This allows for further modification of the message after it has been processed
* by the converter and is useful for setting JMS headers and properties.
*
* <p>Often implemented as a lambda expression or as an anonymous inner class.
* *
* @author Mark Pollack * @author Mark Pollack
* @since 1.1 * @since 1.1
@@ -32,13 +33,15 @@ import javax.jms.Message;
* @see JmsTemplate#convertAndSend(javax.jms.Destination, Object, MessagePostProcessor) * @see JmsTemplate#convertAndSend(javax.jms.Destination, Object, MessagePostProcessor)
* @see org.springframework.jms.support.converter.MessageConverter * @see org.springframework.jms.support.converter.MessageConverter
*/ */
@FunctionalInterface
public interface MessagePostProcessor { public interface MessagePostProcessor {
/** /**
* Apply a MessagePostProcessor to the message. The returned message is * Process the given message.
* typically a modified version of the original. * <p>The returned message is typically a modified version of the original.
* @param message the JMS message from the MessageConverter * @param message the JMS message from the MessageConverter
* @return the modified version of the Message * @return a post-processed variant of the message, or simply the incoming
* message; never {@code null}
* @throws javax.jms.JMSException if thrown by JMS API methods * @throws javax.jms.JMSException if thrown by JMS API methods
*/ */
Message postProcessMessage(Message message) throws JMSException; Message postProcessMessage(Message message) throws JMSException;

View File

@@ -28,13 +28,14 @@ import org.springframework.messaging.Message;
* @see MessageSendingOperations * @see MessageSendingOperations
* @see MessageRequestReplyOperations * @see MessageRequestReplyOperations
*/ */
@FunctionalInterface
public interface MessagePostProcessor { public interface MessagePostProcessor {
/** /**
* Process the given message. * Process the given message.
* @param message the message to process * @param message the message to process
* @return a post-processed variant of the message, * @return a post-processed variant of the message, or simply the incoming
* or simply the incoming message; never {@code null} * message; never {@code null}
*/ */
Message<?> postProcessMessage(Message<?> message); Message<?> postProcessMessage(Message<?> message);