由于心跳而导致的 Tibco FT 问题
我的 Java 应用程序的 2 个实例(A 和 B)在同一台计算机上运行,其中 B 被 activate()
回调阻止。
这就是我注册回调的方式:
new TibrvFtMember(this.tibrvQueue,
this.orv,
this.transport,
MessagingProps.TIBCO_GROUP_FT, // Group name
wt, // Weight
1, // Active members
2.0, // Heartbeat (secs.)
0.0, // Prep. (secs.)
2.5, // Activation (secs.)
null);
我每 100 毫秒发送一次心跳,以确保我的应用程序按时完成。
msg.add("Data", ++seq + ":" + MessagingProps.TIBCO_SUBJECT_FT);
msg.setSendSubject(MessagingProps.TIBCO_SUBJECT_FT);
transport.send(msg)
由于某种原因(例如 GC/垃圾收集),如果我的主动应用程序“A”延迟发送心跳,我的被动应用程序“B”会立即被激活,而“A”仍然处于活动状态,其中“A”上不会调用停用。应用程序“A”发送心跳后不久,就会在应用程序“B”上调用 deactivate。由于两个应用程序同时处于活动状态,因此这会导致几秒钟的错误行为。
上述情况是随机发生的,不可预测。我们的应用程序不能同时发布重复的消息,因此这会产生巨大的影响。
请帮助我如何克服这个问题。
I have 2 instance of my Java application (A & B) running on same machine, where B is blocked for activate()
callback.
This is how I register my callback:
new TibrvFtMember(this.tibrvQueue,
this.orv,
this.transport,
MessagingProps.TIBCO_GROUP_FT, // Group name
wt, // Weight
1, // Active members
2.0, // Heartbeat (secs.)
0.0, // Prep. (secs.)
2.5, // Activation (secs.)
null);
I sending heartbeat every 100 millisecond to ensure that my application is on time.
msg.add("Data", ++seq + ":" + MessagingProps.TIBCO_SUBJECT_FT);
msg.setSendSubject(MessagingProps.TIBCO_SUBJECT_FT);
transport.send(msg)
For some reason (ex., GC / garbage collection) if my active application "A" delays in sending heartbeat, immediately my passive application "B" gets activated while "A" is still active, where deactivate is not invoked on "A". And soon after application "A" sending a heartbeat, deactivate is invoked on application "B". This give an erroneous behavior for a few seconds since both the applications are active at the same time.
The mentioned is happens at random time and not predictable. Our application cannot publish duplicate messages at same time, so this creates a huge impact.
Kindly help me to how can I overcome this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论