Package net.lshift.rabbitmq

Source Code of net.lshift.rabbitmq.ReceiverImpl

package net.lshift.rabbitmq;

import java.io.IOException;

import com.rabbitmq.client.Connection;
import com.rabbitmq.messagepatterns.unicast.ConnectionListener;
import com.rabbitmq.messagepatterns.unicast.Thunk;

/**
* Extension of the MP implementation to support Queue deletion.
*/
public class ReceiverImpl extends com.rabbitmq.messagepatterns.unicast.impl.ReceiverImpl {
   
    public void deleteQueue() throws Exception {
        while (true) {
            if (connector.attempt(new Thunk() {
                public void run() throws IOException {
                    channel.queueDelete(getQueueName(), false, false);
                }
            }, new ConnectionListener() {
                public void connected(Connection conn) throws IOException {
                    connect(conn);
                }})) break;
        }
    }
}
TOP

Related Classes of net.lshift.rabbitmq.ReceiverImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.