我在Windows 7 PC上运行Rendezvous。我运行了Tibco提供的C ++示例代码,实现了一个简单的认证消息发送者(cmsender.cpp)和一个经过认证的消息监听器(cmlistener.cpp)。
原则上,运行这两个程序的结果似乎是发送者发送10条消息,而监听器应该接收10条消息并明确确认每条消息都已收到。但是,在输出中看起来并不正确:
发件人输出:
Publishing 10 certified messages on subject cm.test.subject
Publishing message: {index=1}
Publishing message: {index=2}
Confirmed message with seqno=2
Publishing message: {index=3}
Confirmed message with seqno=3
Publishing message: {index=4}
Confirmed message with seqno=4
Publishing message: {index=5}
Confirmed message with seqno=5
Publishing message: {index=6}
Confirmed message with seqno=6
Publishing message: {index=7}
Confirmed message with seqno=7
Publishing message: {index=8}
Confirmed message with seqno=8
Publishing message: {index=9}
Confirmed message with seqno=9
Publishing message: {index=10}
Last sequence number to be confirmed = 10
Confirmed message with seqno=10
监听器输出:
Listening on subject: cm.test.subject
Received message: {index=1}
status=Item not found, seqno=0
Received message: {index=2}
status=Success, seqno=2
Confirming message with seqno=2
Received message: {index=3}
status=Success, seqno=3
Confirming message with seqno=3
Received message: {index=4}
status=Success, seqno=4
Confirming message with seqno=4
Received message: {index=5}
status=Success, seqno=5
Confirming message with seqno=5
Received message: {index=6}
status=Success, seqno=6
Confirming message with seqno=6
Received message: {index=7}
status=Success, seqno=7
Confirming message with seqno=7
Received message: {index=8}
status=Success, seqno=8
Confirming message with seqno=8
Received message: {index=9}
status=Success, seqno=9
Confirming message with seqno=9
Received message: {index=10}
status=Success, seqno=10
Confirming message with seqno=10
请注意,在发送方输出中,永远不会确认seqno = 1的消息。此外,在侦听器输出中,找不到seqno = 0的消息。 (我稍微修改了Tibco cmlistener.cpp示例代码以打印出状态和seqno值,以进行故障排除,但除此之外,代码仍然是原样。)
是否有人使用此Rendezvous示例代码知道这是否是预期的行为?为什么没有确认seqno = 1的消息?为什么听众没有看到seqno = 1的消息?为什么seqno = 0的消息导致状态为"找不到项目"?