[jboss-user] [JBoss Messaging] - Re: Receiving IllegalStateExceptions in client

bander do-not-reply at jboss.com
Wed Feb 14 21:03:50 EST 2007


Just to sum things up - the following receiver code appears to work ok under jboss messaging:


  | Session session = connection.createSession(false,
  | 		Session.AUTO_ACKNOWLEDGE);
  | Queue q = session.createQueue(getQueueName());
  | 
  | MessageConsumer consumer = session.createConsumer(q);
  | consumer.setMessageListener(getMessageListener());
  | 

The following receiver code will result in IllegalStateExceptions under jboss messaging:


  | consumers = new MessageConsumer[5];
  | sessions = new Session[5];
  | 
  | for (int x = 0; x < consumers.length; x++) {
  | 	sessions[x] = connection.createSession(false,
  | 			Session.AUTO_ACKNOWLEDGE);
  | 	Queue q = sessions[x].createQueue(getQueueName());
  | 
  | 	consumers[x] = sessions[x].createConsumer(q);
  | 	consumers[x].setMessageListener(getMessageListener());
  | }
  | 

Is the code above is violating the jms spec? (the test that uses this code does work on other JMS server implementations e.g. Sun Messaging - but that has its own issues).

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

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



More information about the jboss-user mailing list