本文整理匯總了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);
}