Example usage for org.springframework.jms.listener.adapter MessageListenerAdapter setMessageConverter

List of usage examples for org.springframework.jms.listener.adapter MessageListenerAdapter setMessageConverter

Introduction

In this page you can find the example usage for org.springframework.jms.listener.adapter MessageListenerAdapter setMessageConverter.

Prototype

public void setMessageConverter(@Nullable MessageConverter messageConverter) 

Source Link

Document

Set the converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to JMS messages.

Usage

From source file:uk.gov.nationalarchives.discovery.taxonomy.batch.config.DeleteMsgConfiguration.java

@Bean
MessageListenerAdapter deleteListenerAdapter(DeleteDocMessageConsumer deleteDocMessageConsumer) {
    MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter(deleteDocMessageConsumer);
    messageListenerAdapter.setMessageConverter(null);
    return messageListenerAdapter;
}

From source file:uk.gov.nationalarchives.discovery.taxonomy.batch.config.CategorisationMsgConfiguration.java

@Bean
MessageListenerAdapter categorisationListenerAdapter(
        CategoriseDocMessageConsumer categoriseDocMessageConsumer) {
    MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter(categoriseDocMessageConsumer);
    messageListenerAdapter.setMessageConverter(null);
    return messageListenerAdapter;
}

From source file:org.springframework.flex.messaging.jms.JmsAdapter.java

/**
 * /*from  w w  w  .j  a  va  2  s.co m*/
 * {@inheritDoc}
 */
public void afterPropertiesSet() {
    Assert.notNull(this.connectionFactory, "connectionFactory is required");
    Assert.notNull(this.destination, "destination or destination name is required");
    this.jmsTemplate.setConnectionFactory(this.connectionFactory);
    MessageConverter converterToSet = this.messageConverter;
    if (converterToSet == null || !(converterToSet instanceof FlexMessageConverter)) {
        converterToSet = new FlexMessageConverter(converterToSet);
    }
    this.jmsTemplate.setMessageConverter(converterToSet);
    MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter();
    messageListenerAdapter.setMessageConverter(converterToSet);
    messageListenerAdapter.setDelegate(this);
    this.messageListenerContainer.setConnectionFactory(this.connectionFactory);
    this.messageListenerContainer.setMessageListener(messageListenerAdapter);
    this.messageListenerContainer.setAutoStartup(false);
    if (this.destination instanceof Destination) {
        this.jmsTemplate.setDefaultDestination((Destination) this.destination);
        this.messageListenerContainer.setDestination((Destination) this.destination);
    } else {
        this.jmsTemplate.setPubSubDomain(this.pubSubDomain);
        this.jmsTemplate.setDefaultDestinationName((String) this.destination);
        this.messageListenerContainer.setPubSubDomain(this.pubSubDomain);
        this.messageListenerContainer.setDestinationName((String) this.destination);
    }
    this.jmsTemplate.afterPropertiesSet();
    this.messageListenerContainer.afterPropertiesSet();
}