users@jmsjca.java.net

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

From: Frank Kieviet <Frank.Kieviet_at_Sun.COM>
Date: Wed, 10 Dec 2008 17:43:42 -0800

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-prope
rty-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-n
ame>

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

</activation-config-property>

<activation-config-property>

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

<activation-config-property-value>lookup://targetTopic</activation-config-pr
operty-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-propert
y-value>

</activation-config-property>

<activation-config-property>

<activation-config-property-name>RedeliveryHandling</activation-config-prope
rty-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