简体   繁体   English

为JMS队列创建定制属性

[英]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.

相关问题 WebSphere 7中的按日期交付的定制JMS队列 - Custom JMS Queue in WebSphere 7 to Delivery by Date JMS / HornetQ = 如何从客户端以编程方式创建 JMS 队列? - JMS / HornetQ = How to Create a JMS Queue programmatically from the client? 在独立应用程序中为JMS队列创建远程使用者 - Create Remote Consumer for JMS Queue in standalone app 如何在JMS 2中创建临时队列并访问它 - How to create temporary queue and access it in JMS 2 如何创建临时jms队列并通过名称连接到它? - How to create a temporary jms queue and connect to it by name? 如何从 Spring JMS 侦听器中的 JMS 消息获取自定义属性 - How to get custom properties from JMS message in a Spring JMS Listener Apache Camel JMS:尝试连接到队列时“不允许创建目标” - Apache Camel JMS: “Not allowed to create destination” when trying to connect to a queue 如何在Wildfly 10服务器中以编程方式创建JMS队列/主题。 - How to create a JMS queue/topic programmatically in wildfly 10 server. 如何使用Activemq在jboss 6中创建jms消息队列? - How to create jms message queue in jboss 6 using Activemq? 如何在 JEE 服务器(Wildfly)中的 JMS 临时队列上创建侦听器? - How to create a listener on a JMS Temporary Queue in a JEE server (Wildfly)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM