Hi Asanka/Heshitha, Yes. If we create a transacted session all ACK modes are invalidated. Only commit() and rollback() is possible in a transacted session. Hence one flag is enough to denote if it is transactional.
Thanks On Wed, Jan 3, 2018 at 11:41 AM, Asanka Abeyweera <[email protected]> wrote: > I think that pattern corresponds to how the 1st method (createSession(boolean > transacted) type works. That is we ignore the acknowledge mode and use > the transport.jms.SessionTransacted parameter for creating transacted > sessions. Maybe to improve the user experience we can omit the > transport.jms.SessionTransacted parameter and use the acknowledge mode > for all modes including transacted sessions. WDYT? > > On Wed, Jan 3, 2018 at 11:17 AM, Chanika Geeganage <[email protected]> > wrote: > >> According to the spec, if session transacted, the session should be >> committed/ rollback. But in our code we set isTransacted flag to true only >> if transport.jms.SessionTransacted is set, but not when the acknowledge >> mode is set to SESSION_TRANSACTED, and therefore session commit/rollback >> happens only when transport.jms.SessionTransacted is set [1]. Do we have >> to change that logic to commit/rollback when the acknowledge mode is set to >> SESSION_TRANSACTED also? >> >> [1] https://github.com/wso2/carbon-mediation/blob/master/compone >> nts/inbound-endpoints/org.wso2.carbon.inbound.endpoint/ >> src/main/java/org/wso2/carbon/inbound/endpoint/protocol/jms/ >> JMSPollingConsumer.java#L236 >> >> >> >> >> On Wed, Jan 3, 2018 at 11:00 AM, Asanka Abeyweera <[email protected]> >> wrote: >> >>> Hi Heshitha, >>> >>> There are two methods we can use to create a transacted session in JMS, >>> >>> 1. createSession(boolean transacted, int acknowledgeMode)- you can >>> set the transacted parameter to true to create a transacted session. >>> Acknowledge mode is ignored when the transacted parameter is set to true. >>> 2. createSession(int sessionMode) - you can use SESSION_TRANSACTED >>> as acknowledge mode to create a transacted session. AFAIK this >>> method is only vailable in JMS 2. >>> >>> You can use either of the methods depending on the JMS version used and >>> the behaviuor should be similar. >>> >>> On Wed, Jan 3, 2018 at 10:06 AM, Heshitha Hettihewa <[email protected]> >>> wrote: >>> >>>> Hi, >>>> >>>> Inside JMS inbound endpoint code base there is a ack mode for >>>> SESSION_TRANSACTED [1] as well as transport.jms.SessionTransacted >>>> property[2]. In JMS specs(in 1.0, 1.1 and 2.0) SESSION_TRANSACTED ack mode >>>> is not defined. But this is used in Java JMS api [3]. Are these two methods >>>> used for the same purpose?. Or is there any difference?. >>>> >>>> [1]. https://github.com/wso2/carbon-mediation/blob/master/compone >>>> nts/inbound-endpoints/org.wso2.carbon.inbound.endpoint/src/m >>>> ain/java/org/wso2/carbon/inbound/endpoint/protocol/jms/facto >>>> ry/JMSConnectionFactory.java#L155 >>>> [2]. https://github.com/wso2/carbon-mediation/blob/master/compone >>>> nts/inbound-endpoints/org.wso2.carbon.inbound.endpoint/src/m >>>> ain/java/org/wso2/carbon/inbound/endpoint/protocol/jms/facto >>>> ry/JMSConnectionFactory.java#L138 >>>> [3]. https://docs.oracle.com/javaee/7/api/javax/jms/Session.html# >>>> SESSION_TRANSACTED >>>> >>>> Thanks, >>>> Heshitha. >>>> -- >>>> Heshitha Hettihewa >>>> *Software Engineer* >>>> Mobile : +94716866386 >>>> <%2B94%20%280%29%20773%20451194> >>>> [email protected] >>>> >>> >>> >>> >>> -- >>> Asanka Abeyweera >>> Associate Technical Lead >>> WSO2 Inc. >>> >>> Phone: +94 712228648 <+94%2071%20222%208648> >>> Blog: a5anka.github.io >>> >>> <https://wso2.com/signature> >>> >> >> >> >> -- >> Best Regards.. >> >> Chanika Geeganage >> +94773522586 <+94%2077%20352%202586> >> WSO2, Inc.; http://wso2.com >> >> > > > -- > Asanka Abeyweera > Associate Technical Lead > WSO2 Inc. > > Phone: +94 712228648 > Blog: a5anka.github.io > > <https://wso2.com/signature> > -- *Hasitha Abeykoon* Associate Technical Lead; WSO2, Inc.; http://wso2.com *cell:* *+94 719363063* *blog: **abeykoon.blogspot.com* <http://abeykoon.blogspot.com>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
