Rationalize AMQP sample

This commit is contained in:
Dave Syer
2015-07-07 13:50:32 +01:00
parent 406d4ea771
commit 4581c5a273
3 changed files with 21 additions and 42 deletions

View File

@@ -16,10 +16,6 @@
package sample.amqp;
import javax.annotation.PostConstruct;
import org.springframework.amqp.core.AmqpAdmin;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
@@ -29,14 +25,6 @@ public class Sender {
@Autowired
private RabbitTemplate rabbitTemplate;
@Autowired
private AmqpAdmin amqpAdmin;
@PostConstruct
public void setUpQueue() {
this.amqpAdmin.declareQueue(new Queue("foo"));
}
@Scheduled(fixedDelay = 1000L)
public void send() {
this.rabbitTemplate.convertAndSend("foo", "hello");