Class MQTTWireFormat
java.lang.Object
org.apache.activemq.transport.mqtt.MQTTWireFormat
- All Implemented Interfaces:
org.apache.activemq.wireformat.WireFormat
Implements marshalling and unmarsalling the MQTT protocol.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
int
int
void
marshal
(Object command, DataOutput dataOut) void
setConnectAttemptTimeout
(long connectTimeout) Sets the timeout value used to fail a connection if no CONNECT frame is read in the given interval.void
setMaxFrameSize
(int maxFrameSize) Sets the maximum frame size for an incoming MQTT frame.void
setVersion
(int version) unmarshal
(ByteSequence packet)
-
Constructor Details
-
MQTTWireFormat
public MQTTWireFormat()
-
-
Method Details
-
marshal
- Specified by:
marshal
in interfaceorg.apache.activemq.wireformat.WireFormat
- Throws:
IOException
-
unmarshal
- Specified by:
unmarshal
in interfaceorg.apache.activemq.wireformat.WireFormat
- Throws:
IOException
-
marshal
- Specified by:
marshal
in interfaceorg.apache.activemq.wireformat.WireFormat
- Throws:
IOException
-
unmarshal
- Specified by:
unmarshal
in interfaceorg.apache.activemq.wireformat.WireFormat
- Throws:
IOException
-
setVersion
public void setVersion(int version) - Specified by:
setVersion
in interfaceorg.apache.activemq.wireformat.WireFormat
- Parameters:
version
- the version of the wire format
-
getVersion
public int getVersion()- Specified by:
getVersion
in interfaceorg.apache.activemq.wireformat.WireFormat
- Returns:
- the version of the wire format
-
getMaxFrameSize
public int getMaxFrameSize()- Returns:
- the maximum number of bytes a single MQTT message frame is allowed to be.
-
setMaxFrameSize
public void setMaxFrameSize(int maxFrameSize) Sets the maximum frame size for an incoming MQTT frame. The protocl limit is 256 megabytes and this value cannot be set higher.- Parameters:
maxFrameSize
- the maximum allowed frame size for a single MQTT frame.
-
getConnectAttemptTimeout
public long getConnectAttemptTimeout()- Returns:
- the timeout value used to fail a connection if no CONNECT frame read.
-
setConnectAttemptTimeout
public void setConnectAttemptTimeout(long connectTimeout) Sets the timeout value used to fail a connection if no CONNECT frame is read in the given interval.- Parameters:
connectTimeout
- the connection frame received timeout value.
-