Java Code Examples for org.springframework.messaging.core.AbstractMessageSendingTemplate

The following examples show how to use org.springframework.messaging.core.AbstractMessageSendingTemplate. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
protected Object preProcessResponse(Object result) {
	MethodParameter returnType = getHandlerMethod().getReturnType();
	if (result instanceof Message) {
		return MessageBuilder.fromMessage((Message<?>) result)
				.setHeader(AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build();
	}
	return MessageBuilder.withPayload(result).setHeader(
			AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build();
}
 
Example 2
@Override
protected Object preProcessResponse(Object result) {
	MethodParameter returnType = getHandlerMethod().getReturnType();
	if (result instanceof Message) {
		return MessageBuilder.fromMessage((Message<?>) result)
				.setHeader(AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build();
	}
	return MessageBuilder.withPayload(result).setHeader(
			AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build();
}
 
Example 3
/**
 * Configure a {@link MessageConverter} to use to convert the payload of a message from
 * its serialized form with a specific MIME type to an Object matching the target method
 * parameter. The converter is also used when sending a message to the message broker.
 * @see CompositeMessageConverter
 */
public void setMessageConverter(MessageConverter converter) {
	this.messageConverter = converter;
	if (converter != null) {
		((AbstractMessageSendingTemplate<?>) this.clientMessagingTemplate).setMessageConverter(converter);
	}
}
 
Example 4
/**
 * Configure a {@link MessageConverter} to use to convert the payload of a message from
 * its serialized form with a specific MIME type to an Object matching the target method
 * parameter. The converter is also used when sending a message to the message broker.
 * @see CompositeMessageConverter
 */
public void setMessageConverter(MessageConverter converter) {
	this.messageConverter = converter;
	((AbstractMessageSendingTemplate<?>) this.clientMessagingTemplate).setMessageConverter(converter);
}
 
Example 5
/**
 * Configure a {@link MessageConverter} to use to convert the payload of a message from
 * its serialized form with a specific MIME type to an Object matching the target method
 * parameter. The converter is also used when sending a message to the message broker.
 * @see CompositeMessageConverter
 */
public void setMessageConverter(MessageConverter converter) {
	this.messageConverter = converter;
	((AbstractMessageSendingTemplate<?>) this.clientMessagingTemplate).setMessageConverter(converter);
}