void pn_message_inspect()

in c/src/core/message.c [172:330]


void pn_message_inspect(void *obj, pn_fixed_string_t *dst)
{
  pn_message_t *msg = (pn_message_t *) obj;
  pn_fixed_string_addf(dst, "Message{");

  bool comma = false;

  if (pn_string_get(msg->address)) {
    pn_fixed_string_addf(dst, "address=");
    pn_finspect(msg->address, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (msg->durable) {
    pn_fixed_string_addf(dst, "durable=%i, ", msg->durable);
    comma = true;
  }

  if (msg->priority != AMQP_HEADER_PRIORITY_DEFAULT) {
    pn_fixed_string_addf(dst, "priority=%u, ", msg->priority);
    comma = true;
  }

  if (msg->ttl) {
    pn_fixed_string_addf(dst, "ttl=%" PRIu32 ", ", msg->ttl);
    comma = true;
  }

  if (msg->first_acquirer) {
    pn_fixed_string_addf(dst, "first_acquirer=%i, ", msg->first_acquirer);
    comma = true;
  }

  if (msg->delivery_count) {
    pn_fixed_string_addf(dst, "delivery_count=%" PRIu32 ", ", msg->delivery_count);
    comma = true;
  }

  pn_atom_t id = pn_message_get_id(msg);
  if (id.type!=PN_NULL) {
    pn_fixed_string_addf(dst, "id=");
    pni_inspect_atom(&id, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_string_get(msg->user_id)) {
    pn_fixed_string_addf(dst, "user_id=");
    pn_finspect(msg->user_id, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_string_get(msg->subject)) {
    pn_fixed_string_addf(dst, "subject=");
    pn_finspect(msg->subject, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_string_get(msg->reply_to)) {
    pn_fixed_string_addf(dst, "reply_to=");
    pn_finspect(msg->reply_to, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  pn_atom_t correlation_id = pn_message_get_correlation_id(msg);
  if (correlation_id.type!=PN_NULL) {
    pn_fixed_string_addf(dst, "correlation_id=");
    pni_inspect_atom(&correlation_id, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_string_get(msg->content_type)) {
    pn_fixed_string_addf(dst, "content_type=");
    pn_finspect(msg->content_type, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_string_get(msg->content_encoding)) {
    pn_fixed_string_addf(dst, "content_encoding=");
    pn_finspect(msg->content_encoding, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (msg->expiry_time) {
    pn_fixed_string_addf(dst, "expiry_time=%" PRIi64 ", ", msg->expiry_time);
    comma = true;
  }

  if (msg->creation_time) {
    pn_fixed_string_addf(dst, "creation_time=%" PRIi64 ", ", msg->creation_time);
    comma = true;
  }

  if (pn_string_get(msg->group_id)) {
    pn_fixed_string_addf(dst, "group_id=");
    pn_finspect(msg->group_id, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (msg->group_sequence) {
    pn_fixed_string_addf(dst, "group_sequence=%" PRIu32 ", ", msg->group_sequence);
    comma = true;
  }

  if (pn_string_get(msg->reply_to_group_id)) {
    pn_fixed_string_addf(dst, "reply_to_group_id=");
    pn_finspect(msg->reply_to_group_id, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (msg->inferred) {
    pn_fixed_string_addf(dst, "inferred=%i, ", msg->inferred);
    comma = true;
  }

  if (pn_data_size(msg->instructions_deprecated)) {
    pn_fixed_string_addf(dst, "instructions=");
    pn_finspect(msg->instructions_deprecated, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_data_size(msg->annotations_deprecated)) {
    pn_fixed_string_addf(dst, "annotations=");
    pn_finspect(msg->annotations_deprecated, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_data_size(msg->properties_deprecated)) {
    pn_fixed_string_addf(dst, "properties=");
    pn_finspect(msg->properties_deprecated, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (pn_data_size(msg->body_deprecated)) {
    pn_fixed_string_addf(dst, "body=");
    pn_finspect(msg->body_deprecated, dst);
    pn_fixed_string_addf(dst, ", ");
    comma = true;
  }

  if (comma) {
    dst->position = dst->position - 2;
 }

  pn_fixed_string_addf(dst, "}");
  return;
}