June 2018
Intermediate to advanced
408 pages
11h 23m
English
Spring AMQP’s RabbitTemplate provides everything for the basic AMQP operations. The following code creates an instance of RabbitTemplate using connectionFactory:
@Beanpublic RabbitTemplate rabbitTemplate() { RabbitTemplate template = new RabbitTemplate(connectionFactory()); template.setRoutingKey(ROUTING_KEY); template.setExchange(RABBIT_MESSAGE_EXCHANGE); template.setMessageConverter(messageConverter()); return template;}
RabbitTemplate acts as a helper class for the producer to send, and the consumer to receive, the messages.
Read now
Unlock full access