This discussion is archived
3 Replies Latest reply: Feb 28, 2013 6:38 AM by 653697 RSS

Connection Factory redelivery-delay ignored

992695 Newbie
Currently Being Moderated
Hello,

That question is related to setting the "redelivery-delay" property on my Weblogic 9.2 JMS queue.

When I specify that redelivery-delay on the XML configuration of the queue, I got succeeded, and the redelivery attemps are properly managed at the specified time:
  <uniform-distributed-queue name="My_DQueue">
    <default-targeting-enabled>true</default-targeting-enabled>
    <delivery-params-overrides>
      <time-to-live>120000</time-to-live>
      <redelivery-delay>30000</redelivery-delay>
    </delivery-params-overrides>
    <delivery-failure-params>
      <error-destination>My_DQueue_Error</error-destination>
      <redelivery-limit>-1</redelivery-limit>
      <expiration-policy>Redirect</expiration-policy>
    </delivery-failure-params>
    <jndi-name>jms/My_DQueue</jndi-name>
    <load-balancing-policy>Round-Robin</load-balancing-policy>
  </uniform-distributed-queue>
However, I'm not able to specify such value in the Connection Factory configuration, because this value is always ignored. I delete the redelivery-delay property from the queue configuration, and attempt to set in the connection factory configuration:
  <connection-factory name="My_ConnectionFactoryXA">
    <default-targeting-enabled>true</default-targeting-enabled>
    <jndi-name>jms/My_ConnectionFactoryXA</jndi-name>
     <default-delivery-params>
      <default-redelivery-delay>30000</default-redelivery-delay>
    </default-delivery-params>
    <transaction-params>
      <transaction-timeout>300</transaction-timeout>
      <xa-connection-factory-enabled>true</xa-connection-factory-enabled>
    </transaction-params>
    <security-params>
      <attach-jmsx-user-id>false</attach-jmsx-user-id>
    </security-params>
  </connection-factory>
As I say: the value is always ignored by Weblogic when I define it in the Connection Factory config. So messages are redelivered continuously, like they were using a value of 0 delay.

However, if I ask the producer for the redelivery delay of the WLQueueSession, it's correctly returned:
Queue queue = (Queue) initialContext.lookup("jms/My_DQueue");
QueueConnectionFactory qcf = (QueueConnectionFactory) initialContext.lookup( "jms/My_ConnectionFactoryXA" );
QueueConnection queueCon = qcf.createQueueConnection();
WLQueueSession queueSession = (WLQueueSession)queueCon.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
logger.info("getRedeliveryDelay="+queueSession.getRedeliveryDelay());   // Returns 30.000
So, is there any way to configure the redelivery delay on the connection factory, instead of define it in the queue?

Thanks in advance!

Joan Esteve

Edited by: 989692 on 26-feb-2013 0:12

Edited by: joan_esteve on 27-feb-2013 0:11
  • 1. Re: Connection Factory redelivery-delay ignored
    653697 Journeyer
    Currently Being Moderated
    Did you set the redelivery delay value to 30000 after the consumer's connection has already created? Any change to this setting will take effect only on new connections; all consumers on the existing connections will not be affected. You can restart your consumer and see if the new setting takes effect.
    Does your consumer use the same connection factory as your producer? Can you check the value on the consumer's session?
    Regards,
    Dongbo
  • 2. Re: Connection Factory redelivery-delay ignored
    992695 Newbie
    Currently Being Moderated
    Thanks for your reply Dongbo.

    I configured the parameters directly in the XML config file for my WL9.2 MP2 domain. Then I fully restart the server after any change on that file.

    However, default redelivery-delay specified at connection factory (instead of queue) is always ignored.

    My producer uses the WLQueueSession, and the getRedeliveryDelay() method correctly returns the value specified in the config file.

    However, the consumer (which is a MessageDrivenBean) is always using a 0 value.

    Both consumer and producer use the same connection factory, and point to the same queue.

    My MDB consumer extends org.springframework.ejb.support.AbstractJmsMessageDrivenBean.

    I tried to follow your suggestion of checking the value in my consumer session. However, I'm not able to find how to get that session object inside my MDB class. That class only implements the typicall onMessage(), setMessageDrivenContext(), onEjbCreate(),... methods. But I don't know how can I obtain a reference to the session directly from the MDB .

    And one (brand new) question. My consumer extends org.springframework.ejb.support.AbstractJmsMessageDrivenBean. Do you think i may proper change it to another implementation class from weblogic packages instead of a spring-based one? I mean: if I wish to use a weblogic-specific MessageDrivenBean, which class should I extend?

    Thanks again!

    Joan Esteve
  • 3. Re: Connection Factory redelivery-delay ignored
    653697 Journeyer
    Currently Being Moderated
    Hi Joan,

    I don't think there is a way for you to get access to the session object that a MDB is using.
    Is it possible that your consumer uses a connection factory that uses default redelivery delay setting? You can check it by turning on MDB debugging with
    -Dweblogic.debug.DebugEjbMdbConnection. The debugging messages will be in the server log file. The debugging messages should tell you the JNDI name of the connection factory that the MDB is actually using.

    If you want to use WebLogic specific classes, your MDB consumer can extend weblogic.ejb.GenericMessageDrivenBean.java and then implement javax.jms.MessageListener interface.

    Hope this helps.
    Dongbo

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points