Package org.apache.activemq.transport

Examples of org.apache.activemq.transport.ResponseCallback


        final Response[] answer = new Response[1];
        ResponseCorrelator responseCorrelator = new ResponseCorrelator(local);
        responseCorrelator.setTransportListener(new VMTestTransportListener(localReceived));
        responseCorrelator.start();
        responseCorrelator.asyncRequest(new DummyCommand(), new ResponseCallback() {
            @Override
            public void onCompletion(FutureResponse resp) {
                try {
                    answer[0] = resp.getResult();
                } catch (IOException e) {
View Full Code Here


        msgDispatch.setConsumerId(((ConsumerInfo) localConsumer.arguments[0]).getConsumerId());
        // send advisory of path 2, doesn't send a ConsumerInfo to localBroker
        remoteListener.onCommand(path2Msg);
        // (2a) send a message
        localListener.onCommand(msgDispatch);
        ResponseCallback callback = (ResponseCallback) firstMessageFuture.arguments[1];
        FutureResponse response = new FutureResponse(callback);
        response.set(new Response());

        // send advisory of path 2 remove, doesn't send a RemoveInfo to localBroker
        remoteListener.onCommand(removePath2Msg);
View Full Code Here

        msgDispatch.setConsumerId(((ConsumerInfo) localConsumer.arguments[0]).getConsumerId());
        // send advisory of path 2, doesn't send a ConsumerInfo to localBroker
        remoteListener.onCommand(path2Msg);
        // (2a) send a message
        localListener.onCommand(msgDispatch);
        ResponseCallback callback = (ResponseCallback) firstMessageFuture.arguments[1];
        FutureResponse response = new FutureResponse(callback);
        response.set(new Response());

        // send advisory of path 1 remove, shouldn't send a RemoveInfo to localBroker
        remoteListener.onCommand(removePath1Msg);
View Full Code Here

                            // The message was not sent using async send, so we
                            // should only ack the local
                            // broker when we get confirmation that the remote
                            // broker has received the message.
                            ResponseCallback callback = new ResponseCallback() {
                                public void onCompletion(FutureResponse future) {
                                    try {
                                        Response response = future.getResult();
                                        if (response.isException()) {
                                            ExceptionResponse er = (ExceptionResponse)response;
View Full Code Here

        } else {
            if (isClosed()) {
                throw new ConnectionClosedException();
            }
            try {
                this.transport.asyncRequest(command, new ResponseCallback() {
                    @Override
                    public void onCompletion(FutureResponse resp) {
                        Response response;
                        Throwable exception = null;
                        try {
View Full Code Here

                                }
                                // message being forwarded - we need to
                                // propagate the response to our local send
                                message.setProducerId(duplexInboundLocalProducerInfo.getProducerId());
                                if (message.isResponseRequired() || configuration.isAlwaysSyncSend()) {
                                    duplexInboundLocalBroker.asyncRequest(message, new ResponseCallback() {
                                        final int correlationId = message.getCommandId();

                                        @Override
                                        public void onCompletion(FutureResponse resp) {
                                            try {
View Full Code Here

                        if (message.isPersistent() || configuration.isAlwaysSyncSend()) {

                            // The message was not sent using async send, so we should only
                            // ack the local broker when we get confirmation that the remote
                            // broker has received the message.
                            remoteBroker.asyncRequest(message, new ResponseCallback() {
                                @Override
                                public void onCompletion(FutureResponse future) {
                                    try {
                                        Response response = future.getResult();
                                        if (response.isException()) {
View Full Code Here

                    // The message was not sent using async send, so we should
                    // only ack the local
                    // broker when we get confirmation that the remote broker
                    // has received the message.
                    ResponseCallback callback = new ResponseCallback() {
                        public void onCompletion(FutureResponse future) {
                            try {
                                Response response = future.getResult();
                                if (response.isException()) {
                                    ExceptionResponse er = (ExceptionResponse)response;
View Full Code Here

        } else {
            if (isClosed()) {
                throw new ConnectionClosedException();
            }
            try {
                this.transport.asyncRequest(command, new ResponseCallback() {
                    @Override
                    public void onCompletion(FutureResponse resp) {
                        Response response;
                        Throwable exception = null;
                        try {
View Full Code Here

                                }
                                // message being forwarded - we need to
                                // propagate the response to our local send
                                message.setProducerId(duplexInboundLocalProducerInfo.getProducerId());
                                if (message.isResponseRequired() || configuration.isAlwaysSyncSend()) {
                                    duplexInboundLocalBroker.asyncRequest(message, new ResponseCallback() {
                                        final int correlationId = message.getCommandId();

                                        @Override
                                        public void onCompletion(FutureResponse resp) {
                                            try {
View Full Code Here

TOP

Related Classes of org.apache.activemq.transport.ResponseCallback

Copyright © 2018 www.massapicom. 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.