Skip to content

Commit 34cc8bf

Browse files
committed
Modify pull consumer example
1 parent 8879b2f commit 34cc8bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

example/PullConsumeMessage.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int main(int argc, char *argv[]) {
7373
case E_FOUND:
7474
printf("Get Message Size:%d\n", pullResult.size);
7575
for (k = 0; k < pullResult.size; ++k) {
76-
printf("Got Message ID:%s,Body:%s", GetMessageId(pullResult.msgFoundList[k]),GetMessageBody(pullResult.msgFoundList[k]));
76+
printf("Got Message ID:%s,Body:%s\n", GetMessageId(pullResult.msgFoundList[k]),GetMessageBody(pullResult.msgFoundList[k]));
7777
}
7878
break;
7979
case E_NO_MATCHED_MSG:
@@ -82,7 +82,8 @@ int main(int argc, char *argv[]) {
8282
default:
8383
noNewMsg = 0;
8484
}
85-
85+
ReleasePullResult(pullResult);
86+
thread_sleep(100);
8687
} while (noNewMsg == 0);
8788
thread_sleep(1000);
8889
}

0 commit comments

Comments
 (0)