Search in sources :

Example 1 with JsonbMessageConverter

use of org.springframework.messaging.converter.JsonbMessageConverter in project spring-framework by spring-projects.

the class AbstractMessageBrokerConfiguration method brokerMessageConverter.

@Bean
public CompositeMessageConverter brokerMessageConverter() {
    List<MessageConverter> converters = new ArrayList<>();
    boolean registerDefaults = configureMessageConverters(converters);
    if (registerDefaults) {
        converters.add(new StringMessageConverter());
        converters.add(new ByteArrayMessageConverter());
        if (jackson2Present) {
            converters.add(createJacksonConverter());
        } else if (gsonPresent) {
            converters.add(new GsonMessageConverter());
        } else if (jsonbPresent) {
            converters.add(new JsonbMessageConverter());
        } else if (kotlinSerializationJsonPresent) {
            converters.add(new KotlinSerializationJsonMessageConverter());
        }
    }
    return new CompositeMessageConverter(converters);
}
Also used : StringMessageConverter(org.springframework.messaging.converter.StringMessageConverter) KotlinSerializationJsonMessageConverter(org.springframework.messaging.converter.KotlinSerializationJsonMessageConverter) ByteArrayMessageConverter(org.springframework.messaging.converter.ByteArrayMessageConverter) JsonbMessageConverter(org.springframework.messaging.converter.JsonbMessageConverter) ArrayList(java.util.ArrayList) GsonMessageConverter(org.springframework.messaging.converter.GsonMessageConverter) JsonbMessageConverter(org.springframework.messaging.converter.JsonbMessageConverter) ByteArrayMessageConverter(org.springframework.messaging.converter.ByteArrayMessageConverter) KotlinSerializationJsonMessageConverter(org.springframework.messaging.converter.KotlinSerializationJsonMessageConverter) CompositeMessageConverter(org.springframework.messaging.converter.CompositeMessageConverter) GsonMessageConverter(org.springframework.messaging.converter.GsonMessageConverter) MessageConverter(org.springframework.messaging.converter.MessageConverter) MappingJackson2MessageConverter(org.springframework.messaging.converter.MappingJackson2MessageConverter) StringMessageConverter(org.springframework.messaging.converter.StringMessageConverter) CompositeMessageConverter(org.springframework.messaging.converter.CompositeMessageConverter) Bean(org.springframework.context.annotation.Bean)

Aggregations

ArrayList (java.util.ArrayList)1 Bean (org.springframework.context.annotation.Bean)1 ByteArrayMessageConverter (org.springframework.messaging.converter.ByteArrayMessageConverter)1 CompositeMessageConverter (org.springframework.messaging.converter.CompositeMessageConverter)1 GsonMessageConverter (org.springframework.messaging.converter.GsonMessageConverter)1 JsonbMessageConverter (org.springframework.messaging.converter.JsonbMessageConverter)1 KotlinSerializationJsonMessageConverter (org.springframework.messaging.converter.KotlinSerializationJsonMessageConverter)1 MappingJackson2MessageConverter (org.springframework.messaging.converter.MappingJackson2MessageConverter)1 MessageConverter (org.springframework.messaging.converter.MessageConverter)1 StringMessageConverter (org.springframework.messaging.converter.StringMessageConverter)1