List of usage examples for org.springframework.messaging.converter ByteArrayMessageConverter ByteArrayMessageConverter
public ByteArrayMessageConverter()
From source file:org.springframework.cloud.stream.converter.CompositeMessageConverterFactory.java
private void initDefaultConverters() { this.converters.add(new TupleJsonMessageConverter(this.objectMapper)); MappingJackson2MessageConverter jsonMessageConverter = new MappingJackson2MessageConverter(); jsonMessageConverter.setSerializedPayloadClass(String.class); if (this.objectMapper != null) { jsonMessageConverter.setObjectMapper(this.objectMapper); }/*from w w w . ja v a2 s.com*/ this.converters.add(jsonMessageConverter); this.converters.add(new ByteArrayMessageConverter()); this.converters.add(new ObjectStringMessageConverter()); this.converters.add(new JavaSerializationMessageConverter()); this.converters.add(new JsonUnmarshallingConverter(this.objectMapper)); }
From source file:org.openwms.common.comm.app.DriverConfig.java
@Bean
ByteArrayMessageConverter byteArrayMessageConverter() {
return new ByteArrayMessageConverter();
}
From source file:org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.java
/** * Create an instance of SimpAnnotationMethodMessageHandler with the given * message channels and broker messaging template. * @param clientInboundChannel the channel for receiving messages from clients (e.g. WebSocket clients) * @param clientOutboundChannel the channel for messages to clients (e.g. WebSocket clients) * @param brokerTemplate a messaging template to send application messages to the broker *///from w ww .jav a 2 s .c om public SimpAnnotationMethodMessageHandler(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SimpMessageSendingOperations brokerTemplate) { Assert.notNull(clientInboundChannel, "clientInboundChannel must not be null"); Assert.notNull(clientOutboundChannel, "clientOutboundChannel must not be null"); Assert.notNull(brokerTemplate, "brokerTemplate must not be null"); this.clientInboundChannel = clientInboundChannel; this.clientMessagingTemplate = new SimpMessagingTemplate(clientOutboundChannel); this.brokerTemplate = brokerTemplate; Collection<MessageConverter> converters = new ArrayList<>(); converters.add(new StringMessageConverter()); converters.add(new ByteArrayMessageConverter()); this.messageConverter = new CompositeMessageConverter(converters); }