nevado-jms/src/main/java/org/skyscreamer/nevado/jms/NevadoSession.java
// TODO - Think about how to handle a failure during commit (a break mid-way would fool atomicity)
Think about how to handle a failure during commit (a break mid-way would fool atomicity)
Think about how to handle a failure during commit ( a break mid - way would fool atomicity )
@Override
    public void commit() throws JMSException
    {
        checkClosed();
        if (!_transacted)
        {
            throw new IllegalStateException("Cannot commit an untransacted session");
        }
        for(NevadoDestination destination : _outgoingTxMessages.keySet())
        {
            List<NevadoMessage> outgoingMessages = _outgoingTxMessages.get(destination);
            _connection.getSQSConnector().sendMessages(destination, outgoingMessages);
        }
        _outgoingTxMessages.clear();
        _incomingStagedMessages.acknowledgeConsumedMessages();
    }
@ Override public void commit ( ) throws JMSException { checkClosed ( ) ; if ( ! _transacted ) { throw new IllegalStateException ( "Cannot commit an untransacted session" ) ; } for ( NevadoDestination destination : _outgoingTxMessages . keySet ( ) ) { List < NevadoMessage > outgoingMessages = _outgoingTxMessages . get ( destination ) ; _connection . getSQSConnector ( ) . sendMessages ( destination , outgoingMessages ) ; } _outgoingTxMessages . clear ( ) ; _incomingStagedMessages . acknowledgeConsumedMessages ( ) ; }
TODO - Think about how to handle a failure during commit (a break mid-way would fool atomicity)
TODO - Think about how to handle a failure during commit ( a break mid - way would fool atomicity )