WebSphere Message Brokers
File: ac11000_
Writer: Kate Hostler

Reference topic

This build: July 31, 2007 21:18:10

SUBACK Subscription acknowledgment

A SUBACK message is sent by the broker to the client to confirm receipt of a SUBSCRIBE message.

A SUBACK message contains a list of granted QoS levels. These are the levels at which the administrators for the broker permit the client to subscribe to a specific topic name. In the current version of the protocol, the broker always grants the QoS level requested by the subscriber. The order of granted QoS levels in the SUBACK message matches the order of the topic Nnames in the corresponding SUBSCRIBE message.

Fixed header

The table below shows the format of the fixed header.

bit 7 6 5 4 3 2 1 0
byte 1 Message Type (9) DUP flag QoS level RETAIN
  1 0 0 1 x x x x
byte 2 Remaining Length
QoS level
Not used.
DUP flag
Not used.
RETAIN flag
Not used.
Remaining Length field
The length of the variable header. It can be a multibyte field.

Variable header

The variable header contains the Message ID for the SUBSCRIBE message that is being acknowledged. The table below shows the format of the variable header.

bit 7 6 5 4 3 2 1 0
byte 1 Message ID MSB
byte 2 Message ID LSB

Payload

The payload contains a vector of granted QoS levels. Each level corresponds to a topic name in the corresponding SUBSCRIBE message. The order of QoS levels in the SUBACK message matches the order of topic name and Requested QoS pairs in the SUBSCRIBE message. The Message ID in the variable header enables you to match SUBACK messages with the corresponding SUBSCRIBE messages.

The table below shows the Granted QoS field encoded in a byte.

bit 7 6 5 4 3 2 1 0
  Reserved Reserved Reserved Reserved Reserved Reserved QoS level
  x x x x x x    

The upper 6 bits of this byte are not used in the current version of the protocol. They are reserved for future use.

The table below shows an example payload.

Granted QoS 0
Granted QoS 2

The table below shows the format of this payload.

  Description 7 6 5 4 3 2 1 0
Requested QoS
byte 1 Granted QoS (0) x x x x x x 0 0
Granted QoS
byte 2 Granted QoS (2) x x x x x x 1 0
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:18:10

ac11000_ This topic's URL is: