0 Replies Latest reply on Jun 24, 2003 2:34 PM by Skely

    JMS Singleton.. How to

    Skely Newbie

       

      "Skely" wrote:
      Hi Guys,

      My requirement is to get (onMessage) notification one by one.
      Next notification should wait until I finish my onMessage method.

      So I created my own type of MessageDrivenBean and named it "Singleton Message Driven Bean" and configured the following in standardjboss.xml

      <container-configuration>
      <container-name>Singleton Message Driven Bean</container-name>
      <call-logging>false</call-logging>
      <!--invoker-proxy-binding-name>message-driven-bean</invoker-proxy-binding-name-->
      <container-interceptors>
      <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
      <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
      <interceptor>org.jboss.ejb.plugins.RunAsSecurityInterceptor</interceptor>
      <!-- CMT -->
      <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
      <interceptor transaction="Container" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
      <interceptor transaction="Container">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
      <!-- BMT -->
      <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
      <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT</interceptor>
      <interceptor transaction="Bean" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
      <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
      </container-interceptors>
      <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
      <instance-cache></instance-cache>
      <persistence-manager></persistence-manager>
      <container-pool-conf>
      <MaximumSize>100</MaximumSize>
      </container-pool-conf>
      <invoker-proxy-binding>
      <name>message-driven-bean</name>
      <invoker-mbean>default</invoker-mbean>
      <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
      <proxy-factory-config>
      <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
      <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
      <!--MaximumSize>15</MaximumSize-->
      <MaximumSize>1</MaximumSize>
      <MaxMessages>1</MaxMessages>
      <MDBConfig>
      <ReconnectIntervalSec>10</ReconnectIntervalSec>
      <DLQConfig>
      <DestinationQueue>queue/DLQ</DestinationQueue>
      <MaxTimesRedelivered>10</MaxTimesRedelivered>
      <TimeToLive>0</TimeToLive>
      </DLQConfig>
      </MDBConfig>
      </proxy-factory-config>
      </invoker-proxy-binding>
      </container-configuration>

      When I used this configuration in my MessageDrivenbean, even though I limited the JMSPool to be 1, it is not behaving the way I want. It just flushes the onMessage call before my method ends. Am I doing anything wrong. Could anybody suggest me please.

      I'm running on jboss-3.2.1_tomcat-4.1.24, and JDK1.4.1 on windows platform.

      Thanks in advance,
      Magesh