本文整理汇总了Java中org.springframework.amqp.rabbit.core.RabbitTemplate.setRoutingKey方法的典型用法代码示例。如果您正苦于以下问题:Java RabbitTemplate.setRoutingKey方法的具体用法?Java RabbitTemplate.setRoutingKey怎么用?Java RabbitTemplate.setRoutingKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.amqp.rabbit.core.RabbitTemplate
的用法示例。
在下文中一共展示了RabbitTemplate.setRoutingKey方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: rabbitTemplate
import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
public RabbitTemplate rabbitTemplate()
{
RabbitTemplate template = new RabbitTemplate(connectionFactory());
template.setRoutingKey(this.tasksQueue);
template.setQueue(this.tasksQueue);
template.setMessageConverter(jsonMessageConverter());
return template;
}
开发者ID:BernhardWenzel,项目名称:scraping-microservice-java-python-rabbitmq,代码行数:10,代码来源:TaskProducerConfiguration.java
示例3: rabbitTemplate
import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
public RabbitTemplate rabbitTemplate() {
RabbitTemplate template = new RabbitTemplate(connectionFactory());
template.setRoutingKey(this.scrapingResultQueue);
template.setQueue(this.scrapingResultQueue);
template.setMessageConverter(jsonMessageConverter());
return template;
}
开发者ID:BernhardWenzel,项目名称:scraping-microservice-java-python-rabbitmq,代码行数:9,代码来源:ScrapingResultConsumerConfiguration.java
示例4: fixedReplyQRabbitTemplate
import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
RabbitTemplate fixedReplyQRabbitTemplate(Exchange exchange, @Qualifier(REPLY_Q) Queue replyQueue, ConnectionFactory connectionFactory) {
RabbitTemplate template = new RabbitTemplate(connectionFactory);
template.setExchange(exchange.getName());
template.setRoutingKey(this.routingKey);
template.setReplyTimeout(-1); // this means that it should wait forever for a reply. TODO is this too dangerous ?
template.setReplyQueue(replyQueue);
return template;
}
示例5: init
import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
/**
*
*/
private static void init() {
connectionFactory = newConnectionFactory();
rabbitTemplate = new RabbitTemplate(connectionFactory);
rabbitTemplate.setMessageConverter(new ElfMessageConverter());
rabbitTemplate.setRoutingKey(CLIENT_SYNC_RCP_Q);
rabbitTemplate.setReplyTimeout(-1);
rabbitAdmin = new RabbitAdmin(connectionFactory);
}
示例6: rabbitTemplate
import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
public RabbitTemplate rabbitTemplate()
{
RabbitTemplate template = new RabbitTemplate(connectionFactory());
template.setRoutingKey(this.queueName);
template.setQueue(this.queueName);
template.setMessageConverter(jsonMessageConverter());
return template;
}
示例7: template
import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
@Bean
public RabbitTemplate template() {
RabbitTemplate rabbitTemplate = new RabbitTemplate(rabbitConnectionFactory);
rabbitTemplate.setRoutingKey("msg.request");
return rabbitTemplate;
}
示例8: sendMessage
import org.springframework.amqp.rabbit.core.RabbitTemplate; //导入方法依赖的package包/类
public void sendMessage(Message msg, String queue) {
msg.getMessageProperties().setTimestamp(new Date());
RabbitTemplate template = new RabbitTemplate(SingletonConnectionFactory.getConnection(host, username, password));
template.setRoutingKey(queue);
template.setQueue(queue);
template.send(queue, queue, msg);
}