Package org.fusesource.mqtt.client

Examples of org.fusesource.mqtt.client.QoS.ordinal()


                try {
                    onReSubscribe(mqttSubscription);
                } catch (IOException e) {
                    throw new MQTTProtocolException("Failed to find subscription strategy", true, e);
                }
                return (byte) requestedQoS.ordinal();
            }
        }

        try {
            return onSubscribe(destinationName, requestedQoS);
View Full Code Here


                onUnSubscribe(topicName);
            } else {
                // duplicate SUBSCRIBE packet, find all matching topics and resend retained messages
                resendRetainedMessages(topicName, destination, mqttSubscription);

                return (byte) topicQoS.ordinal();
            }
            onUnSubscribe(topicName);
        }

        ConsumerId id = new ConsumerId(sessionId, consumerIdGenerator.getNextSequenceId());
View Full Code Here

        consumerInfo.setDestination(destination);
        consumerInfo.setPrefetchSize(getActiveMQSubscriptionPrefetch());
        consumerInfo.setRetroactive(true);
        consumerInfo.setDispatchAsync(true);
        // create durable subscriptions only when cleansession is false
        if ( !connect.cleanSession() && connect.clientId() != null && topicQoS.ordinal() >= QoS.AT_LEAST_ONCE.ordinal() ) {
            consumerInfo.setSubscriptionName(topicQoS + ":" + topicName.toString());
        }
        MQTTSubscription mqttSubscription = new MQTTSubscription(this, topicQoS, consumerInfo);

        // optimistic add to local maps first to be able to handle commands in onActiveMQCommand
View Full Code Here

                if (response.isException()) {
                    final Throwable throwable = ((ExceptionResponse) response).getException();
                    LOG.warn("Error subscribing to " + topicName, throwable);
                    qos[0] = SUBSCRIBE_ERROR;
                } else {
                    qos[0] = (byte) topicQoS.ordinal();
                }
            }
        });

        if (qos[0] == SUBSCRIBE_ERROR) {
View Full Code Here

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.