1 Reply Latest reply on Apr 2, 2009 1:35 PM by sshetty

    How to turn off redelivery when using jbr-provider

      Hi,

      I have a service which is listening on a jbr-provider. The action in the service takes a long time to finish execution. In the meanwhile, I see the the ESB redelivering the message. The message contains the partial response and not the original request, which the action does not expect.

      Here is an simplified version of the problem:

      jboss-esb.xml

       <service category="CMTE" name="Search Content" description="Search Content" invmScope="GLOBAL">
       <property name="maxThreads" value="200"/>
       <listeners>
       <jbr-listener name="Cmte Search Content Gateway"
       busidref="cmte_search_content_http_end_point" is-gateway="true" maxThreads="200">
       <property name="jbr-maxThreads" value="200"/>
       </jbr-listener>
       </listeners>
       <actions mep="RequestResponse">
       <action name="SearchContent" class="test.SlowAction"
       process="process" />
       </actions>
       </service>
      


      SlowAction.java

      public class SlowAction extends AbstractActionLifecycle
      {
       private static final Logger logger = Logger.getLogger(SlowAction.class);
       protected ConfigTree config;
      
       public SlowAction(ConfigTree config)
       {
       this.config = config;
       }
      
       public Message process(Message message) throws Exception
       {
       Body mb = message.getBody();
       logger.info("entering process: " + mb.get(Body.DEFAULT_LOCATION));
      
       mb.add("response " + System.currentTimeMillis());
       try
       {
       // trying to simulate the processing here
       Thread.sleep(60*1000);
       }
       catch (Exception e)
       {}
       logger.info("leaving process: " + mb.get(Body.DEFAULT_LOCATION));
       return message;
       }
      }
      


      I sent exactly 1 request to the endpoint and here is the output in the logs:

      09:44:55,598 INFO [SlowAction] (pool-83-thread-1) entering process: topic=newsarticle&category=intl
      09:45:15,606 INFO [SlowAction] (pool-83-thread-2) entering process: response 1238687095598
      09:45:55,600 INFO [SlowAction] (pool-83-thread-1) leaving process: response 1238687115606
      09:46:15,613 INFO [SlowAction] (pool-83-thread-2) leaving process: response 1238687115606


      I see the process method invoked a 2nd time after 20 secs. But the message is already updated (from the previous invocation).

      Questions:
      1. How can I turn off the redelivery ?
      2. How can I configure the redelivery interval ?

      I have tried editing the jbossesb.sar/jbossesb-properties.xml, but have had no luck so far.

      Any help appreciated.

      Thanks

      :)
      SShetty