當前位置: 首頁>>代碼示例>>Java>>正文


Java RabbitTemplate.setMessageConverter方法代碼示例

本文整理匯總了Java中org.springframework.amqp.rabbit.core.RabbitTemplate.setMessageConverter方法的典型用法代碼示例。如果您正苦於以下問題:Java RabbitTemplate.setMessageConverter方法的具體用法?Java RabbitTemplate.setMessageConverter怎麽用?Java RabbitTemplate.setMessageConverter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.amqp.rabbit.core.RabbitTemplate的用法示例。


在下文中一共展示了RabbitTemplate.setMessageConverter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getObject

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Override
public AmqpTemplate getObject() throws Exception {
    RabbitTemplate rabbitTemplate = rabbitAdmin.getRabbitTemplate();
    rabbitTemplate.setMessageConverter(messageConverter);
    rabbitTemplate.setRetryTemplate(retryTemplate());

    if (messagingConfiguration.isMandatoryMessages()) {
        logger.info("will send mandatoryMessages, which expect at least one consumer");

        rabbitTemplate.setMandatory(true);
        rabbitTemplate.setReturnCallback(createReturnCallback());
    } else {
        logger.info("mandatory flag is not set, messages are not being set as mandatory");
    }

    return rabbitTemplate;
}
 
開發者ID:zeroDivisible,項目名稱:spring-rabbitmq-example,代碼行數:18,代碼來源:AmqpTemplateFactory.java

示例2: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
public RabbitTemplate rabbitTemplate() {
	RabbitTemplate template = new RabbitTemplate(connectionFactory());
	template.setQueue(this.queueName);
       template.setMessageConverter(jsonMessageConverter());
	return template;
}
 
開發者ID:microservices-demo,項目名稱:queue-master,代碼行數:8,代碼來源:ShippingConsumerConfiguration.java

示例3: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
/**
 * This returns the RabbitMQ template.
 *
 * @return The RabbitMQ template.
 */
@Bean
RabbitTemplate rabbitTemplate()
{
    final RabbitTemplate template = new RabbitTemplate(rabbitConnectionFactory);
    template.setMessageConverter(messageConverter());
    template.setRetryTemplate(retryTemplate());
    return template;
}
 
開發者ID:dellemc-symphony,項目名稱:ticketing-service-paqx-parent-sample,代碼行數:14,代碼來源:TicketingServiceRabbitConfig.java

示例4: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
@ConditionalOnSingleCandidate(ConnectionFactory.class)
@ConditionalOnMissingBean(RabbitTemplate.class)
public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    RetryTemplate retryTemplate = new RetryTemplate();
    ExponentialBackOffPolicy backOffPolicy = new ExponentialBackOffPolicy();
    backOffPolicy.setInitialInterval(500);
    backOffPolicy.setMultiplier(10.0);
    backOffPolicy.setMaxInterval(10000);
    retryTemplate.setBackOffPolicy(backOffPolicy);
    template.setRetryTemplate(retryTemplate);
    template.setMessageConverter(messageConverter);
    return template;
}
 
開發者ID:lodsve,項目名稱:lodsve-framework,代碼行數:16,代碼來源:RabbitConfiguration.java

示例5: commandBusRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
@Autowired
public RabbitTemplate commandBusRabbitTemplate(final ConnectionFactory commandBusConnectionFactory, final MessageConverter commandBusMessageConverter) {

    log.info("Creating command bus RabbitMQ template with a custom JSON converter");
    final RabbitTemplate rabbitTemplate = new RabbitTemplate(commandBusConnectionFactory);
    rabbitTemplate.setMessageConverter(commandBusMessageConverter);

    return rabbitTemplate;
}
 
開發者ID:sem2nawara,項目名稱:acme-solution,代碼行數:11,代碼來源:CommandBusConfigurer.java

示例6: eventBusRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
@Autowired
public RabbitTemplate eventBusRabbitTemplate(final ConnectionFactory eventBusConnectionFactory, final MessageConverter eventBusMessageConverter) {

    log.info("Creating query event bus RabbitMQ template with a custom JSON converter");
    final RabbitTemplate rabbitTemplate = new RabbitTemplate(eventBusConnectionFactory);
    rabbitTemplate.setMessageConverter(eventBusMessageConverter);

    return rabbitTemplate;
}
 
開發者ID:sem2nawara,項目名稱:acme-solution,代碼行數:11,代碼來源:EventBusConfigurer.java

示例7: eventBusRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
@Autowired
@Primary
public RabbitTemplate eventBusRabbitTemplate(final ConnectionFactory eventBusConnectionFactory, final MessageConverter eventBusMessageConverter) {

    log.info("Creating event bus RabbitMQ template with a custom JSON converter");
    final RabbitTemplate rabbitTemplate = new RabbitTemplate(eventBusConnectionFactory);
    rabbitTemplate.setMessageConverter(eventBusMessageConverter);

    return rabbitTemplate;
}
 
開發者ID:sem2nawara,項目名稱:acme-solution,代碼行數:12,代碼來源:EventBusConfigurer.java

示例8: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
public RabbitTemplate rabbitTemplate(Jackson2JsonMessageConverter converter) {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setRoutingKey(queueName);
    template.setMessageConverter(converter);
    return template;
}
 
開發者ID:giovannicandido,項目名稱:audit-mq-collector,代碼行數:8,代碼來源:RabbitConfiguration.java

示例9: replicationRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
public RabbitTemplate replicationRabbitTemplate(
        ConnectionFactory connectionFactory,
        MessageConverter replicationMessageConverter
) {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setExchange(replicationExchange);
    template.setMessageConverter(replicationMessageConverter);

    return template;
}
 
開發者ID:dvoraka,項目名稱:av-service,代碼行數:13,代碼來源:AmqpReplicationClientConfig.java

示例10: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
public RabbitTemplate rabbitTemplate(
        ConnectionFactory connectionFactory,
        MessageConverter messageConverter
) {
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setMessageConverter(messageConverter);

    return template;
}
 
開發者ID:dvoraka,項目名稱:av-service,代碼行數:12,代碼來源:AmqpFileCommonConfig.java

示例11: outRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
public RabbitTemplate outRabbitTemplate(
        ConnectionFactory outConnectionFactory,
        MessageConverter outMessageConverter
) {
    RabbitTemplate template = new RabbitTemplate(outConnectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setQueue(resultQueue);
    template.setMessageConverter(outMessageConverter);

    return template;
}
 
開發者ID:dvoraka,項目名稱:av-service,代碼行數:13,代碼來源:AmqpBridgeOutputConfig.java

示例12: fileServerRabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
public RabbitTemplate fileServerRabbitTemplate(
        ConnectionFactory serverConnectionFactory,
        MessageConverter fileServerMessageConverter
) {
    RabbitTemplate template = new RabbitTemplate(serverConnectionFactory);
    template.setReceiveTimeout(listeningTimeout);
    template.setMessageConverter(fileServerMessageConverter);

    return template;
}
 
開發者ID:dvoraka,項目名稱:av-service,代碼行數:12,代碼來源:AmqpServerConfig.java

示例13: submitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
  public RabbitTemplate submitTemplate() {
      RabbitTemplate bean = new RabbitTemplate(connectionFactory());
      bean.setMessageConverter(jsonMessageConverter());
// para enviar, el binding del exchange se configura en el rabbitmq
      // server a la cola correspondiente (que aqui no interesa)
      bean.setExchange(env.getProperty("submit.exchange"));
      return bean;
  }
 
開發者ID:dovier,項目名稱:coj-web,代碼行數:10,代碼來源:AMQPConfiguration.java

示例14: plagiarismDetectorTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
public RabbitTemplate plagiarismDetectorTemplate() {
    RabbitTemplate bean = new RabbitTemplate(connectionFactory());
    bean.setMessageConverter(jsonMessageConverter());
    bean.setExchange(env.getProperty("plagiarism.detection.exchange"));
    return bean;
}
 
開發者ID:dovier,項目名稱:coj-web,代碼行數:8,代碼來源:AMQPConfiguration.java

示例15: rabbitTemplate

import org.springframework.amqp.rabbit.core.RabbitTemplate; //導入方法依賴的package包/類
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
//必須是prototype類型
public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(this.connectionFactory());
    template.setMessageConverter(this.jsonMessageConverter());
    template.setMandatory(true);
    return template;
}
 
開發者ID:liubo6,項目名稱:demo_springboot_rabbitmq,代碼行數:10,代碼來源:AmqpConfig.java


注:本文中的org.springframework.amqp.rabbit.core.RabbitTemplate.setMessageConverter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。