解决Tibco EMS和.NET API中的预取 [英] Working around pre-fetch in Tibco EMS and .NET API

查看:87
本文介绍了解决Tibco EMS和.NET API中的预取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有内容都在Tibco EMS 5. *和.NET API的背景下

All in context of Tibco EMS 5.* and .NET API

我必须处理现有的消息处理模型,该模型处于循环状态:

I've to work along existing model of message processing, in which in a loop:

  • 连接已创建/打开
  • 会话已创建/打开
  • 创建了消息使用者
  • 接收方法称为

如果message!= null,则我们使用它并提交或回滚事务(在基础会话上).系统会在该模型中每隔x秒拉动一次.

if message != null then we consume it and either commit or rollback the transaction (on underlying session). System pulls every x sec in that model.

我创建了一个连接工厂,以确保仅创建新的会话(如果以前的会话仍在使用中).这样,系统就可以在同一连接上工作.

I've created a connection factory that assures that only new sessions are created (if the previous session is still in use). In that way system works on the same connection.

但是,由于每个Receive调用(通过.NET接口)返回一条消息并将几条(pre-fetch-1)放入本地队列,因此在预提取方面遇到了问题. 因此,下一次我应该真正重用同一会话,以读取已提取的消息. 我放入了包装程序,以重新使用会话&消息使用者,只要那里有东西(接收不会返回null). 这种方法是可行的,但即使在本地仍然获取某些内容,我似乎也无法在Receive上获取null. 似乎只要我在同一连接上,提取的邮件就会被标记为已送达(即使会话已明确关闭).

However, I've run into issue with pre-fetch as each Receive call (by .NET interface) returns one message and puts several (pre-fetch-1) to local queue. So I should reuse the same session next time really in order to read messages that are already pulled. I've put in wrappers to reuse the session & message consumer as long as there is something there (Receive won't return null). This approach kind of works, but it seems that I might have get null on Receive, even though there is still something fetched locally. It also seems that as long as I’m on the same connection fetched messages will be marked as delivered (even if session is explicitly closed).

有人会知道如何使用预取= 1打开连接/会话吗? 还是有更好的解决方案?

Would someone have any idea how to either open connection / session with pre-fetch = 1? Or there is better solution?

预先感谢

推荐答案

解决方法:在队列级别关闭预取.

Workaround: turn-off prefetching on the queue level.

这篇关于解决Tibco EMS和.NET API中的预取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆