Hello!
I'll be as short as possible. Thank you.
Jboss version: 4.0.4RC1
EJB3 version: rc5-PFD
JRE: 1.5.0_06
My persistent queue config:
<mbean code="org.jboss.mq.server.jmx.Queue"
  |           name="jboss.mq.destination:service=Queue,name=myQueue1">
  |     <depends 
optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
  |     <attribute name="MessageCounterHistoryDayLimit">-1</attribute>
  | </mbean>
  | 
My MDB class annotated:
@MessageDriven(activationConfig = {
  | @ActivationConfigProperty(propertyName = "destinationType", propertyValue = 
"javax.jms.Queue"),
  | @ActivationConfigProperty(propertyName = "destination", propertyValue = 
"queue/myQueue1"),
  | @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = 
"Client-acknowledge")
  |         })
  | public class BlogKsgMDBean implements MessageListener {
I'm using several threads to post messages to myQueue1 simultaneously.
Looking over my debug log I see that several instances of my MDB also starts 
simultaneously.
I would like to get it work to handle messages one by one.
No get next message from queue until current handle finish.
But still using MessageListener instead of .receive() method.
Is it possible? How do I have to configure it?
Here's how I post message:
conn = jmsConnectionFactory.createConnection();
  | //sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
  | sess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
  | producer = sess.createProducer((Destination) 
namingContext.lookup("queue/myQueue1"));
  | ObjectMessage msg = sess.createObjectMessage(message);
  | producer.send(msg);
  | producer.close();
  | sess.close();
  | conn.close();

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3943903#3943903

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3943903


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to