Rabbitmq Native Plugin como usar?
14/01/2015 14:19
package com.example
import com.budjb.rabbitmq.RabbitMessageBuilder
class ProdutorController {
def index() {
render new RabbitMessageBuilder().send {
routingKey = "atendimento_ti"
timeout = 0
body = "Produziu-1"
}
}
}
import com.budjb.rabbitmq.MessageContext
class ConsumidorConsumer {
/**
* Consumer configuration.
*/
static rabbitConfig = [
queue: "atendimento_ti"
]
/**
* Handle an incoming RabbitMQ message.
*
* @param body The converted body of the incoming message.
* @param context Properties of the incoming message.
* @return
*/
def handleMessage(def body, MessageContext context) {
println body
return body
}
}
import com.budjb.rabbitmq.RabbitMessageBuilder
class ConsumidorController {
def index() {
render new RabbitMessageBuilder().getBody();
}
}
Para se registrar, clique aqui.