Class MQTTProtocolConverter
java.lang.Object
org.apache.activemq.transport.mqtt.MQTTProtocolConverter
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMQTTProtocolConverter(MQTTTransport mqttTransport, BrokerService brokerService) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontainsMqttWildcard(String value) org.fusesource.mqtt.codec.PUBLISHconvertMessage(org.apache.activemq.command.ActiveMQMessage message) protected MQTTSubscriptionStrategyintorg.apache.activemq.command.ConnectionIdlongbooleanorg.apache.activemq.command.SessionIdbooleanvoidonActiveMQCommand(org.apache.activemq.command.Command command) Dispatch an ActiveMQ commandvoidonMQTTCommand(org.fusesource.mqtt.codec.MQTTFrame frame) Convert a MQTT commandvoidvoidonUnSubscribe(org.fusesource.mqtt.codec.UNSUBSCRIBE command) voidsendToActiveMQ(org.apache.activemq.command.Command command, ResponseHandler handler) voidsetActiveMQSubscriptionPrefetch(int activeMQSubscriptionPrefetch) set the default prefetch size when mapping the MQTT subscription to an ActiveMQ one The default = 1voidsetDefaultKeepAlive(long keepAlive) Set the default keep alive time (in milliseconds) that would be used if configured on server side and the client sends a keep-alive value of 0 (zero) on a CONNECT framevoidsetPublishDollarTopics(boolean publishDollarTopics) voidsetSubsciptionStrategy(MQTTSubscriptionStrategy subsciptionStrategy) void
-
Field Details
-
QOS_PROPERTY_NAME
- See Also:
-
V3_1
public static final int V3_1- See Also:
-
V3_1_1
public static final int V3_1_1- See Also:
-
SINGLE_LEVEL_WILDCARD
- See Also:
-
MULTI_LEVEL_WILDCARD
- See Also:
-
version
public int version
-
-
Constructor Details
-
MQTTProtocolConverter
-
-
Method Details
-
sendToActiveMQ
-
onMQTTCommand
public void onMQTTCommand(org.fusesource.mqtt.codec.MQTTFrame frame) throws IOException, jakarta.jms.JMSException Convert a MQTT command- Throws:
IOExceptionjakarta.jms.JMSException
-
onUnSubscribe
public void onUnSubscribe(org.fusesource.mqtt.codec.UNSUBSCRIBE command) throws MQTTProtocolException - Throws:
MQTTProtocolException
-
onActiveMQCommand
Dispatch an ActiveMQ command- Throws:
Exception
-
convertMessage
public org.fusesource.mqtt.codec.PUBLISH convertMessage(org.apache.activemq.command.ActiveMQMessage message) throws IOException, jakarta.jms.JMSException, DataFormatException - Throws:
IOExceptionjakarta.jms.JMSExceptionDataFormatException
-
getMQTTTransport
-
onTransportError
public void onTransportError() -
getDefaultKeepAlive
public long getDefaultKeepAlive() -
setDefaultKeepAlive
public void setDefaultKeepAlive(long keepAlive) Set the default keep alive time (in milliseconds) that would be used if configured on server side and the client sends a keep-alive value of 0 (zero) on a CONNECT frame- Parameters:
keepAlive- the keepAlive in milliseconds
-
getActiveMQSubscriptionPrefetch
public int getActiveMQSubscriptionPrefetch() -
setActiveMQSubscriptionPrefetch
public void setActiveMQSubscriptionPrefetch(int activeMQSubscriptionPrefetch) set the default prefetch size when mapping the MQTT subscription to an ActiveMQ one The default = 1- Parameters:
activeMQSubscriptionPrefetch- set the prefetch for the corresponding ActiveMQ subscription
-
getPacketIdGenerator
-
setPublishDollarTopics
public void setPublishDollarTopics(boolean publishDollarTopics) -
getPublishDollarTopics
public boolean getPublishDollarTopics() -
getConnectionId
public org.apache.activemq.command.ConnectionId getConnectionId() -
getSessionId
public org.apache.activemq.command.SessionId getSessionId() -
isCleanSession
public boolean isCleanSession() -
getSubscriptionStrategy
-
setSubscriptionStrategy
-
getClientId
-
containsMqttWildcard
-
findSubscriptionStrategy
- Throws:
IOException
-
setSubsciptionStrategy
-