activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Strasheim <>
Subject Difference between JMS and CMS Connection::createSession
Date Fri, 08 Jun 2007 15:06:56 GMT
Hello all

I just noticed that there is a slight difference between JMS 
and CMS with regards to Connection::createSession.

JMS takes a boolean indicating whether the session is transacted, 
followed by an int for the acknowledge mode.

CMS just takes an int for the acknowledge mode.

ActiveMQConnection does the following:

public Session createSession(boolean transacted,int acknowledgeMode) throws JMSException{
  boolean doSessionAsync=alwaysSessionAsync||sessions.size()>0||transacted
  return new ActiveMQSession(this,getNextSessionId(),(transacted?Session.SESSION_TRANSACTED

so transacted=true always means to AUTO_ACKNOWLEDGE as the acknowledge 
mode, otherwise use the acknowledgde mode specified by the user.

Is there a reason why the CMS API doesn't exactly mirror the JMS API in 
this case? It might be worth it, for consistency's sake.



P. S. By the way, does the Java code check whether the specified 
acknowledge mode is valid?

View raw message