[rabbitmq-discuss] Implementing an RPC backend

Ben Hood 0x6e6562 at gmail.com
Sat Jul 7 21:09:32 BST 2007


Hi,

I'm trying to implement a RPC backend to handle client calls. So I
thought I could create a consumer that consumes from the RPC queue and
sends the reply back to the replyTo address. This is the delivery
callback of my consumer:

@Override
public void handleDelivery(AMQP.Basic.Deliver method,
AMQP.BasicProperties properties, byte[] body) throws IOException {

            channel.basicPublish(ticket, "foo", properties.replyTo,
ChannelN.BASIC_PROPERTIES, "bar".getBytes());

}

However, the RPC client still blocks on it's own consumption of the
reply, indicating that the reply wasn't published correctly.

Are there any examples of how this is done using the java API?

Thanks,

Ben




More information about the rabbitmq-discuss mailing list