Package org.apache.activemq.transport.mqtt

Examples of org.apache.activemq.transport.mqtt.ResponseHandler


        // optimistic add to local maps first to be able to handle commands in onActiveMQCommand
        subscriptionsByConsumerId.put(consumerInfo.getConsumerId(), mqttSubscription);
        mqttSubscriptionByTopic.put(topicName, mqttSubscription);

        final byte[] qos = {-1};
        protocol.sendToActiveMQ(consumerInfo, new ResponseHandler() {
            @Override
            public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                // validate subscription request
                if (response.isException()) {
                    final Throwable throwable = ((ExceptionResponse) response).getException();
View Full Code Here


        ConsumerInfo info = subscription.getConsumerInfo();
        if (info != null) {
            subscriptionsByConsumerId.remove(info.getConsumerId());

            RemoveInfo removeInfo = info.createRemoveCommand();
            protocol.sendToActiveMQ(removeInfo, new ResponseHandler() {
                @Override
                public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                    // ignore failures..
                }
            });
View Full Code Here

                RemoveSubscriptionInfo rsi = new RemoveSubscriptionInfo();
                rsi.setConnectionId(protocol.getConnectionId());
                rsi.setSubscriptionName(subscription.getConsumerInfo().getSubscriptionName());
                rsi.setClientId(protocol.getClientId());
                protocol.sendToActiveMQ(rsi, new ResponseHandler() {
                    @Override
                    public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                        // ignore failures..
                    }
                });
View Full Code Here

            for (SubscriptionInfo sub : subs) {
                RemoveSubscriptionInfo rsi = new RemoveSubscriptionInfo();
                rsi.setConnectionId(protocol.getConnectionId());
                rsi.setSubscriptionName(sub.getSubcriptionName());
                rsi.setClientId(sub.getClientId());
                protocol.sendToActiveMQ(rsi, new ResponseHandler() {
                    @Override
                    public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                        // ignore failures..
                    }
                });
View Full Code Here

                DestinationInfo remove = new DestinationInfo();
                remove.setConnectionId(protocol.getConnectionId());
                remove.setDestination(subscription.getDestination());
                remove.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE);

                protocol.sendToActiveMQ(remove, new ResponseHandler() {
                    @Override
                    public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                        // ignore failures..
                    }
                });
View Full Code Here

                DestinationInfo removeAction = new DestinationInfo();
                removeAction.setConnectionId(protocol.getConnectionId());
                removeAction.setDestination(queue);
                removeAction.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE);

                protocol.sendToActiveMQ(removeAction, new ResponseHandler() {
                    @Override
                    public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                        // ignore failures..
                    }
                });
View Full Code Here

TOP

Related Classes of org.apache.activemq.transport.mqtt.ResponseHandler

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.