I would use the qpid::types::Variant::List
. Convert all of your bytes (I assume you're using unsigned char
) to uint8_t
and then append them to the list.
Example:
unsigned char bytesToSend[] = {104, 101, 108, 108, 111}; /* "hello" */
int lengthOfArray = sizeof(bytesToSend)/sizeof(byteToSend[0]);
qpid::types::Variant::List lstToSend;
for(int i = 0; i < lengthOfArray; i++){
uint8_t thisByte = (uint8_t)bytesToSend[i];
lstToSend.push_back(qpid::types::Variant(thisByte));
}
qpid::messaging::Message msg;
qpid::messaging::encode(lstToSend, msg);
yourSender.send(msg, false); /* change false to true if you want to sync with the broker. */
I have not tested this, but it should provide a general overview.
If you have further questions, feel free to ask and I'll try to answer them as best as I can.
References: