9 Replies Latest reply on Jun 5, 2009 5:16 PM by Clebert Suconic

    Sending NonTransactional Messages with journal-sync-non-tran

    Clebert Suconic Master

      I and Tim were running runServer/perfSender with journal-sync-non-transactional = true. And we were having timeouts when doing it.


      This is what I found about the test we were doing:


      - it doesn't make sense to set journal-sync-non-transactional = true, if we don't make BlockOnPersistentSend, BlockOnAcknowledge as true also.

      The client will be sending as fast as it can, but blocking on the server. What will fill up the channel in a way you won't be able to send even pings and pongs.

      The same thing would happen on both AIO and NIO. (I mean.. it would fail on both cases).

      We should probably log a warning on server if Block = false && sync-on-non-transactional = true.

      We should at least document this Warning/Note.






      - There is another issue on QueueImpl when sync-on-non-transactional.
      if sync-non-transactional, both store message, storeReference and eventually updateScheduledDeliveryTime will be calling sync. so.. that would be 2 syncs for every message sent with sync-non-transactional. (or 3 if you schedule the message)

      
      QueueImpl...
      ...
       method route ()
       ....
       if (tx == null)
       {
       if (durableRef)
       {
       if (!message.isStored())
       {
       storageManager.storeMessage(message);
      
       message.setStored();
       }
      
       storageManager.storeReference(ref.getQueue().getPersistenceID(), message.getMessageID());
       }
      
       if (scheduledDeliveryTime != null && durableRef)
       {
       storageManager.updateScheduledDeliveryTime(ref);
       }
      
       addLast(ref);
       }
      



      Maybe we should open a transactional if sync-non-transactional.


      On ServerSessionImpl:

      
       private void doSend(....)
       {
       if (sync-non-transactional)
       {
       .... initialize a transaction somehow...
       ... do what you're supposed to do
       ... transaction.commit();
       }
       else
       {
       ... regular flow
       }
      
      
       }