Skip to content

Client API

sskhiri edited this page Mar 12, 2012 · 19 revisions

Publisher API

The client API is at the boundaries of RoQ and let client caller send messages to queues.

IRoQConnectionFactory factory = new RoQConnectionFactory();
IRoQConnection connection = this.factory.createRoQConnection("logical_queue_name");
connection.open();
//2. Creating the publisher and sending message
IRoQPublisher publisher = this.connection.createPublisher();
publisher.sendMessage("sabri".getBytes(), "hello".getBytes()

Publisher API architecture

The architecture is shown by the Figure below.
The Publisher API architecture. The RoQPublisherConnection manages the life cycle of the PublisherConnectionManager thread. This thread is responsible for targeting the right Exchange, it can be notified through the management channel by the monitor of the queue in order to re-allocate the publisher to another Exchange. This re-allocation can be caused by the Exchange failure or by the fact the Exchange is overloaded.
The close method on the RoQConnection will stop the PublisherConnectionManager thread.

Clone this wiki locally