Here is a small spring program that is expected to place a message in the rabbit Qi:
< Code> Public class main {public static zero main (string [] args throws IOException {Annotation Config Applications Contact Reference = New Animation ConfiP ApplicationContacts (QE Configuration.class); AmqpTemplate Template = context.getBean (AmqpTemplate.class); Template.convertAndSend ("asdflk ..."); Context.destroy (); }}
as follows:
@configure public class Qi configuration {@Bean Public connectionFinal Connection Fighter (New) Caching Connection Factory ("192.168 1.39 "); } @ Bean Public RabbitTemplate rabbitTemplate () {New Rabbit Template (connectionFactory ()); }}
When I check the contents of the queue on the server, nothing gets involved. I also tried to set the name of the exchange or the name of the queue on the place of the rabbit, but still does not show anything on the server
The log of the application does not show any errors, but it logs [Main] DEBUG osamqp.rabbit.core.RabbitTemplate - Callback execution on rabbit MQ channel: Cached Rabbit Channel: AMQChannel (amqp: // guest @ 192.168.1.3 9: 5672 /, 1) 17: 28: 02.441 [Main] Debug OSMMPP.BBT.core Trillion Template - Publishing Message on Exchange [], RoutingKey = []
Any ideas what is wrong?
I had to queue as a parameter in the call to convert: AndSend (): < / P>
template.convertAndSend ("hello2", "asdflk ...");
Still wondering if Spring-AMPP does not throw exceptions. Nobody knows that when no queue is given, where are the messages delivered?
No comments:
Post a Comment