Quality of Service
ServiceMix can handle four parameters that affect the Quality of Service for a given exchange:
- clustered
- synchronous
- transactional
- persistent
These combined parameters defined the QoS for a given exchange, and depending on this QoS, a flow will be selected fo convey this particular exchange.
Synchronicity & Transactionality
...
Actually, all QoS combinations can be handled by one or the other flow, but exchanges that are clustered, transactional and synchronous or persistent, transactional and synchronous.
St: A, S
Seda: A, S, ST
Jms: A, AC, ACP, S, SC, SCP
Jca: A, AC, ACP, ACT, ACPT, APT
Unhandled: SCT, SPT, SCPT
...
| QoS attribute |
---|---|
A | Asynchronous |
S | Synchronous |
C | Clustered (means that the same endpoint is activated on the local container and at least a remote container) |
P |
...
Persistent | |
R |
...
Remote (means that the endpoint is not available locally, but only on a remote container) | |
T | Transactional |
Flow | Handled QoS |
---|---|
St | A, S |
Seda | A, S, ST |
Jms | A, AC, ACP, S, SC, SCP |
Jca | A, AC, ACP, ACT, ACPT, APT |
Unhandled | SCT, SPT, SCPT |
: TransactionalCurrently, there is no distinction between C (clustered) and R (remote), though this should be enhanced to provider support for SCT which would be handled as ST (using the local endpoint).
We would then have,
Flow | Handled QoS |
---|---|
St |
...
A, AC, S, SC | |
Seda |
...
A, AC, S, SC, ST, SCT | |
Jms |
...
A, AC, ACP, AR, ARP, S, SC, SCP, SRP | |
Jca |
...
A, AC, ACP, ACT, ACPT, APT, AR, ARP, ART, ARPT | |
Unhandled |
...
SPT, SCPT, SRPT |
Sending synchronous transactional exchanges
Code Block | ||
---|---|---|
| ||
TransactionManager tm = (TransactionManager) getContext().getTransactionManager(); tm.begin(); InOnly me = createInOnly(); getContext().getDeliveryChannel().sendSync(me); tm.commit(); |
Code Block | ||
---|---|---|
| ||
TransactionManager tm = (TransactionManager) getContext().getTransactionManager(); tm.begin(); InOut me = createInOut(); getContext().getDeliveryChannel().sendSync(me); // retrieve the out message me.setStatus(ExchangeStatus.DONE); getContext().getDeliveryChannel().sendSync(me); tm.commit(); |
Sending asynchronous transactional exchanges
Code Block | ||
---|---|---|
| ||
TransactionManager tm = (TransactionManager) getContext().getTransactionManager(); tm.begin(); InOnly me = createInOnly(); getContext().getDeliveryChannel().send(me); tm.commit(); |
Code Block | ||
---|---|---|
| ||
TransactionManager tm = (TransactionManager) getContext().getTransactionManager(); tm.begin(); InOut me = createInOut(); getContext().getDeliveryChannel().send(me); tm.commit(); |
Receiving and processing transactional exchanges
...
If your component is a MessageExchangeListener, the delivery will automatically be
transacted. You just need to use sendSync if the exchange is synchronous and send
if the exchange is not.Created by Guillaume Nodet
On Fri Jun 02 18:41:25 CEST 2006
Using TimTam