Search in sources :

Example 6 with MappingJackson2MessageConverter

use of org.springframework.jms.support.converter.MappingJackson2MessageConverter in project cas by apereo.

the class JmsTicketRegistryConfiguration method jacksonJmsMessageConverter.

@Bean
public MessageConverter jacksonJmsMessageConverter() {
    final MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
    converter.setTargetType(MessageType.TEXT);
    converter.setTypeIdPropertyName("_type");
    new AbstractJacksonBackedStringSerializer<Object>() {

        private static final long serialVersionUID = 1466569521275630254L;

        @Override
        protected Class getTypeToSerialize() {
            return Object.class;
        }

        @Override
        protected ObjectMapper initializeObjectMapper() {
            final ObjectMapper mapper = super.initializeObjectMapper();
            converter.setObjectMapper(mapper);
            return mapper;
        }
    };
    return converter;
}
Also used : MappingJackson2MessageConverter(org.springframework.jms.support.converter.MappingJackson2MessageConverter) AbstractJacksonBackedStringSerializer(org.apereo.cas.util.serialization.AbstractJacksonBackedStringSerializer) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) StringBean(org.apereo.cas.StringBean) Bean(org.springframework.context.annotation.Bean)

Example 7 with MappingJackson2MessageConverter

use of org.springframework.jms.support.converter.MappingJackson2MessageConverter in project av-service by dvoraka.

the class JmsFileCommonConfig method messageConverter.

@Bean
public MessageConverter messageConverter() {
    MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
    messageConverter.setTypeIdPropertyName("typeId");
    return messageConverter;
}
Also used : MappingJackson2MessageConverter(org.springframework.jms.support.converter.MappingJackson2MessageConverter) Bean(org.springframework.context.annotation.Bean)

Example 8 with MappingJackson2MessageConverter

use of org.springframework.jms.support.converter.MappingJackson2MessageConverter in project POC by rajadilipkolli.

the class JMSApplicationConfig method jacksonJmsMessageConverter.

/**
 * <p>jacksonJmsMessageConverter.</p>
 *
 * @return a {@link org.springframework.jms.support.converter.MessageConverter} object.
 */
@Bean
public MessageConverter jacksonJmsMessageConverter() {
    final MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
    converter.setTargetType(MessageType.TEXT);
    converter.setTypeIdPropertyName("_type");
    return converter;
}
Also used : MappingJackson2MessageConverter(org.springframework.jms.support.converter.MappingJackson2MessageConverter) Bean(org.springframework.context.annotation.Bean)

Example 9 with MappingJackson2MessageConverter

use of org.springframework.jms.support.converter.MappingJackson2MessageConverter in project av-service by dvoraka.

the class JmsFileCommonConfig method messageConverter.

@Bean
public MessageConverter messageConverter() {
    MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
    messageConverter.setTypeIdPropertyName("typeId");
    return messageConverter;
}
Also used : MappingJackson2MessageConverter(org.springframework.jms.support.converter.MappingJackson2MessageConverter) Bean(org.springframework.context.annotation.Bean)

Aggregations

MappingJackson2MessageConverter (org.springframework.jms.support.converter.MappingJackson2MessageConverter)9 Bean (org.springframework.context.annotation.Bean)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 MessageProducer (jakarta.jms.MessageProducer)1 Queue (jakarta.jms.Queue)1 Session (jakarta.jms.Session)1 TextMessage (jakarta.jms.TextMessage)1 Session (javax.jms.Session)1 lombok.val (lombok.val)1 StringBean (org.apereo.cas.StringBean)1 AbstractJacksonBackedStringSerializer (org.apereo.cas.util.serialization.AbstractJacksonBackedStringSerializer)1 Test (org.junit.Test)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 StubTextMessage (org.springframework.jms.StubTextMessage)1 Message (org.springframework.messaging.Message)1 MessageHeaders (org.springframework.messaging.MessageHeaders)1