users@jmsjca.java.net

RE: RE: Configuring message redelivery with jmsjca (sun-jms-adapter) in Glassfish

From: Barsov Aleksey <ABarsov_at_yota.ru>
Date: Wed, 28 Jan 2009 14:21:48 +0300

Hello, Frank!

You sent me an updated sun-jms-adapter.rar month ago, where the problem described below is fixed.
I have used this RAR at the development stage. Now, we are going to production.

We use stable build of GlassfishESB and, as I can see, the issue is not resolved in the sun-jms-adapter.rar included into installed GlassfishESB environment.
So, can I download somewhere a standalone stable jmsjca build with that issue being fixed or have I still use that one you sent to me?

Thanks, Alexej Barsov

From: Frank.Kieviet_at_Sun.COM [mailto:Frank.Kieviet_at_Sun.COM]
Sent: Thursday, December 11, 2008 4:44 AM
To: users_at_jmsjca.dev.java.net
Cc: Shereef.Abdulla_at_Sun.COM; 'Necker Lee'
Subject: RE: Configuring message redelivery with jmsjca (sun-jms-adapter) in Glassfish


Hi Alexej, I posted the snippet below to the forum: http://forums.sun.com/thread.jspa?messageID=10540956.



HTH, Frank









Hi Alexej,



I looked at the problem and found out what the issue is. We recently added some functionality that will test if the dead letter destination is in fact a valid destination -- we thought it's better to find that out upfront, rather than if an error occurs. This is especially important with dead letter destinations being looked up in JNDI: mistakes are easily be made there.



In any case, this new functionality introduced a problem where messages are sent from a queue, and the dead letter destination is a topic, or vice versa, where messages are received from a topic, and the dead letter destination is a queue.



In case you're wondering why: we still need to support JMS 1.0.2 servers. For these servers, the queues and topics are strictly segregated. We do have automated tests that test functionality across domains, but as it turns out, these tests also test some other functionality at the same time that fool the dead-letter-destination-validation into thinking it is the same messaging domain.



In any case, I've have created a fix for this, and I'm testing it right now.



I'll send you an updated RAR by email in case you don't want to wait until the updated bits are available for download. What you also could do, as a workaround, is doing the same trick that fooled the automated test: you can specify the redelivery handling in the MDB code, e.g.



public void onMessage(Message message) {

  message.setStringProperty("JMS_Sun_JMSJCA_RedeliveryHandling", "2:1000; 3:move(queue:*psdmqqueue*)");

  // do stuff

}



HTH, Frank Kieviet





---------------------------------------------------



Your question:



I use Glassfish v2 server and its OpenMQ as JMS Provider.

My MDB is configured to use sun-jms-adapter for accessing JMS Provider.

ra.xml of adapter wasn't change so all configuration is done through the sun-ejb-jar.xml of my MDB.



Type of destination my MDB listens to is javax.jms.Topic.

At the same time, I have defined the following redelivery strategy in the sun-ejb-jar.xml

<activation-config-property>

<activation-config-property-name>RedeliveryHandling</activation-config-property-name>

<activation-config-property-value>2:1000; 3:move(queue:*psdmqqueue*)</activation-config-property-value>

</activation-config-property>



psdmqqueue is an administred server Destination of type javax.jms.Queue. So a target destination of MDB is topic and redelivery should be performed to queue



The problem is that application deplyment failes with this configuration with the following exception:



#|2008-11-22T18:38:48.152+0300|WARNING|sun-appserver9.1|com.stc.jmsjca.core.Activation|_ThreadID=169;_ThreadName=JMSJCA connect;_RequestID=ed86af75-1577-4548-ac57-60ca127a28a2;|JMSJCA-E016: [sync-Durable TopicSubscriber(provisioning_subscription)(lookup://targetTopic) @ [mq://localhost:7676/jms]]: message delivery initiation failed (attempt #85); will retry in 10 seconds. The error was: java.lang.ClassCastException: com.sun.messaging.jmq.jmsclient.XATopicSessionImpl

java.lang.ClassCastException: com.sun.messaging.jmq.jmsclient.XATopicSessionImpl

at com.stc.jmsjca.core.RAJMSObjectFactory.createDestination(RAJMSObjectFactory.java:423)

at com.stc.jmsjca.core.Delivery.createDLQDest(Delivery.java:626)

at com.stc.jmsjca.core.SyncDelivery.start(SyncDelivery.java:204)

at com.stc.jmsjca.core.Activation.asyncStart(Activation.java:535)

at com.stc.jmsjca.core.Activation.access$000(Activation.java:80)

at com.stc.jmsjca.core.Activation$1.run(Activation.java:343)

at java.lang.Thread.run(Thread.java:595)



Could you please help me to figure out what is wrong with my configuration?



Part of sun-ejb-jar.xml related to ra activation spec:



<mdb-resource-adapter>

<resource-adapter-mid>sun-jms-adapter</resource-adapter-mid>

<activation-config>

<activation-config-property>

<activation-config-property-name>ConnectionURL</activation-config-property-name>

<activation-config-property-value>lookup://targetConnFactory</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>Destination</activation-config-property-name>

<activation-config-property-value>lookup://targetTopic</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>DestinationType</activation-config-property-name>

<activation-config-property-value>javax.jms.Topic</activation-config-property-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>RedeliveryHandling</activation-config-property-name>

<activation-config-property-value>2:1000; 3:move(queue:psdmqqueue)</activation-config-property-value>

</activation-config-property>

<!--subscription properties-->

................

</activation-config>

</mdb-resource-adapter>

</ejb>

</enterprise-beans>

</sun-ejb-jar>



> -----Original Message-----

> From: ??????? ?????? [mailto:foster_licey_reg_at_mail.ru]

> Sent: Wednesday, December 10, 2008 05:36

> To: users_at_jmsjca.dev.java.net

> Subject: Configuring message redelivery with jmsjca (sun-jms-adapter) in

> Glassfish

>

> Hello!

>

> I have a question concerning message redelivery facilities provided by

> jmsjca.

> The question is posted on sun forum:

> http://forums.sun.com/thread.jspa?threadID=5354260

>

> Could you please help me to configure message redelivering correctly?

>

> WBR,

> Alexej Barsov

>

>

> ---------------------------------------------------------------------

> To unsubscribe, e-mail: users-unsubscribe_at_jmsjca.dev.java.net

> For additional commands, e-mail: users-help_at_jmsjca.dev.java.net

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.176 / Virus Database: 270.9.16/1842 - Release Date: 10.12.2008 18:53