简体   繁体   中英

Create custom properties for JMS Queue

I am using Jboss.x , EJB3.0.

I have two JMS queues. "A" queue and "Error" Que.

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.

I want to add to the MSG which will be delivered to the error Que, an extra property which I will define. (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. 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. You should read your vendor documentation (JBOSS, apparently) for any details.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM