-
Jan 11th, 2013, 10:06 PM
#1
Why is System.exit() required for use of AmqpTemplate?
Hello All,
I'm looking at a very simple example sending a message using AmqpTemplate#convertAndSend. I don't understand why the program won't terminate w/o an explicit System.exit(0).
Is it because it's waiting on an ACK?
Can someone please explain?
Thanks!
--john
@Grapes([
@Grab(group='org.springframework.amqp', module='spring-rabbit', version='1.1.3.RELEASE')
])
public class SendAmqp {
public static void main(String[] argv) throws Exception {
ConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.host = "localhost"
AmqpAdmin admin = new RabbitAdmin(connectionFactory);
admin.declareQueue(new Queue("myqueue"));
AmqpTemplate template = new RabbitTemplate(connectionFactory);
template.convertAndSend("myqueue", "foo")
//without this, program won't exit
System.exit(0)
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules