java - Whats the point of transactional non xa JMS Sessions? -
is me or jms api inconsistent regards how models transacted , xa transacted equivalents ?
i dont appreciate why there xa forms connectionfactory, queueconnectionfactory, session , on , duplication:
for example
xaqueueconnection xaqueuesession createxaqueuesession() throws jmsexception; queuesession createqueuesession(boolean transacted, int acknowledgemode) throws jmsexception;
contains methods non transacted , transacted session ?
- why both ?
- if have xaqc why want non transacted qs ?
- if wanted why create xaqueueconnection ?
these provide gradient of classes of service. jms allows for...
- messages outside of unit of work
- messages inside of single-phase commit (1pc)
- messages inside of two-phase commit (2pc / xa)
the cost of each of these increases degree of reliability. generally, want use least-cost method application requires. if have non-persistent, expiring, fire-and-forget message (for example, stock ticker event) putting inside unit of work wasteful. similarly, if need transacted session jms resource manager, xa waste.
on other hand, if need xa operations, not mean should use xa operations. example, may have single connection within maintain 1 session xa transactions , session non-xa messaging. first of these receiving requests long-running processes , updating database process details. other session used send periodic status updates. connection must xaconnection performance purposes need both xa , non-xa session underneath it. maintain separate connections method allows perform both xa , non-xa messaging within single connection. brokers many connections, optimization can critical.
admittedly not common use case, it still valid case , useful enough have been included in specification.
Comments
Post a Comment