Proton.pn_message_set_id(_impl, convertToAtom(noProperties ? null : _properties.getMessageId()));
pn_bytes_t userId = new pn_bytes_t();;
if(!noProperties && _properties.getUserId() != null)
{
final Binary binary = _properties.getUserId();
byte[] bytes = new byte[binary.getLength()];
System.arraycopy(binary.getArray(),binary.getArrayOffset(),bytes,0,binary.getLength());
Proton.pn_bytes_from_array(userId, bytes);
}
Proton.pn_message_set_user_id(_impl, userId);