private void sendBatchXA() { try { sendMessages(); // Commit the JTA transaction and start another delistResources(tx); if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Committing JTA transaction"); } tx.commit(); if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Committed JTA transaction"); } tx = startTx(); enlistResources(tx); // Clear the messages messages.clear(); } catch (Exception e) { HornetQJMSServerLogger.LOGGER.bridgeAckError(e); handleFailureOnSend(); } }
private void sendBatchNonTransacted() { try { if (qualityOfServiceMode == QualityOfServiceMode.ONCE_AND_ONLY_ONCE) { // We client ack before sending if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Client acking source session"); } messages.getLast().acknowledge(); if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Client acked source session"); } } sendMessages(); if (maxBatchSize > 1) { // The sending session is transacted - we need to commit it if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Committing target session"); } targetSession.commit(); if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Committed source session"); } } if (qualityOfServiceMode == QualityOfServiceMode.DUPLICATES_OK) { // We client ack after sending // Note we could actually use Session.DUPS_OK_ACKNOWLEDGE here // For a slightly less strong delivery guarantee if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Client acking source session"); } messages.getLast().acknowledge(); if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Client acked source session"); } } // Clear the messages messages.clear(); } catch (Exception e) { HornetQJMSServerLogger.LOGGER.bridgeAckError(e); handleFailureOnSend(); } }
private void sendBatchLocalTx() { try { sendMessages(); if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Committing source session"); } sourceSession.commit(); if (JMSBridgeImpl.trace) { HornetQJMSServerLogger.LOGGER.trace("Committed source session"); } // Clear the messages messages.clear(); } catch (Exception e) { HornetQJMSServerLogger.LOGGER.bridgeAckError(e); handleFailureOnSend(); } }