[英]Create custom properties for JMS Queue
I am using Jboss.x , EJB3.0. 我正在使用Jboss.x和EJB3.0。
I have two JMS queues. 我有两个JMS队列。 "A" queue and "Error" Que. “ A”队列和“错误”队列。
A que has a retry mechanism, so after 3 retries, the MSG will be deliver to an error queue automatically, and there mdb will listen. que具有重试机制,因此3次重试后,MSG将自动传递到错误队列,并且mdb将进行侦听。
I want to add to the MSG which will be delivered to the error Que, an extra property which I will define. 我想添加到MSG,它将传递给错误Que,这是我将定义的额外属性。 (Ofcourse I cant add to the body an extra line, since I have rollbacks, and each time a rollback is being executed, the body will rollback also) (当然,我不能向主体添加额外的行,因为我有回滚,并且每次执行回滚时,主体也会回滚)
So I read little in the net, and I got that I can use the header for this purpose(roll backs wont affect it). 因此,我在网上很少阅读,并且得到了可以为此目的使用标头的信息(回滚不会影响它)。 in order to user the header for my custom property I must create JMSPropertyType and add to it the header. 为了使用我的自定义属性的标题,我必须创建JMSPropertyType并将其添加到标题中。 I didn't find info how to do it, mybe anyone could show me, or maybe there is another way of doing this? 我找不到信息该怎么做,也许有人可以告诉我,或者还有另一种方法可以做到这一点?
thanks, ray. 谢谢,雷。
Transactional retry limits and poison message queues (your error queue) are vendor-specific features. 事务重试限制和有害消息队列(您的错误队列)是特定于供应商的功能。 They're not in the JMS spec. 它们不在JMS规范中。 You should read your vendor documentation (JBOSS, apparently) for any details. 您应该阅读供应商文档(显然是JBOSS)以了解任何详细信息。
I'm skeptical that a failing receiver could add a property to a message as you ask. 我对失败的接收方是否可以按您的要求向邮件中添加属性表示怀疑。 Your vendor might implicitly add some properties itself. 您的供应商本身可能会隐式添加一些属性。 I think I've seen a case (BEA JMS?) where they add some vendor-specific property with the failed delivery attempt count. 我想我已经看到了一个案例(BEA JMS?),其中他们添加了一些特定于供应商的属性,并带有失败的传递尝试计数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.