开发者

Create custom properties for JMS Queue

开发者 https://www.devze.com 2023-02-06 10:37 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消