Search in sources :

Example 1 with MessagingMessageConverter

use of org.springframework.jms.support.converter.MessagingMessageConverter in project spring-framework by spring-projects.

the class JmsListenerContainerFactoryIntegrationTests method messagingMessageConverterCanBeUsed.

@Test
public void messagingMessageConverterCanBeUsed() throws JMSException {
    MessagingMessageConverter converter = new MessagingMessageConverter();
    converter.setPayloadConverter(new UpperCaseMessageConverter());
    this.containerFactory.setMessageConverter(converter);
    testMessageConverterIsUsed();
}
Also used : MessagingMessageConverter(org.springframework.jms.support.converter.MessagingMessageConverter) Test(org.junit.jupiter.api.Test)

Example 2 with MessagingMessageConverter

use of org.springframework.jms.support.converter.MessagingMessageConverter in project spring-framework by spring-projects.

the class JmsMessagingTemplateTests method customConverterAlwaysTakesPrecedence.

@Test
public void customConverterAlwaysTakesPrecedence() {
    MessageConverter customMessageConverter = mock(MessageConverter.class);
    JmsMessagingTemplate messagingTemplate = new JmsMessagingTemplate();
    messagingTemplate.setJmsMessageConverter(new MessagingMessageConverter(customMessageConverter));
    messagingTemplate.setJmsTemplate(this.jmsTemplate);
    messagingTemplate.afterPropertiesSet();
    assertPayloadConverter(messagingTemplate, customMessageConverter);
}
Also used : SimpleMessageConverter(org.springframework.jms.support.converter.SimpleMessageConverter) MessagingMessageConverter(org.springframework.jms.support.converter.MessagingMessageConverter) GenericMessageConverter(org.springframework.messaging.converter.GenericMessageConverter) MessageConverter(org.springframework.jms.support.converter.MessageConverter) MessagingMessageConverter(org.springframework.jms.support.converter.MessagingMessageConverter) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 MessagingMessageConverter (org.springframework.jms.support.converter.MessagingMessageConverter)2 MessageConverter (org.springframework.jms.support.converter.MessageConverter)1 SimpleMessageConverter (org.springframework.jms.support.converter.SimpleMessageConverter)1 GenericMessageConverter (org.springframework.messaging.converter.GenericMessageConverter)1