| Author |  | 
      
        | people Newbie
 
  
  
 Joined: 25 March 2014
 Location: United States
 Online Status: Offline
 Posts: 4
 | 
          It seems like the Mailbee.NET queue is processing the files in the pickup folder randomly.  As a result some times the newer files are processing and the old files still sit in the queue.  Instead, we want it to process them in the order in which it received the files i.e., by date time.  How to configure this?
           | Posted: 05 January 2015 at 12:13pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          QueueRunner.cs in MailBee.NET Queue Core project uses FastDirectoryEnumerator.EnumerateFiles in its Run method. You can replace this with any other enumerating mechanism to get files in certain order.
           | Posted: 05 January 2015 at 2:12pm | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | people Newbie
 
  
  
 Joined: 25 March 2014
 Location: United States
 Online Status: Offline
 Posts: 4
 | 
          Are you suggesting that we download the source code, modify the code, compile our own version Mailbee.Net Queue and install?
           | Posted: 05 January 2015 at 3:34pm | IP Logged |   |  
           | 
 |  
 If so, how do I get the source code?
 
 Thanks,
 
 Sayi
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          The source code is always there. The Visual Studio project is installed by the setup program, along with samples and so on. "Browse source code" button in MailBee.NET Queue Menu opens that folder.
           | Posted: 06 January 2015 at 1:43am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | people Newbie
 
  
  
 Joined: 25 March 2014
 Location: United States
 Online Status: Offline
 Posts: 4
 | 
          I changed the Run function QueueRunner.CS to the following.  Basically, I added the OrderBy clause to the EnumerateFiles.  But, I had to change the .NET framework the code uses to 4.5 from 2.0.  Actually, changing it to 3.5 will be good enough.  But, since upgrading it anyways, I upgraded to the latest.  AfterLogic should provide this functionality as a configurable option rather than a code recompile and deploy option.
           | Posted: 09 January 2015 at 6:28am | IP Logged |   |  
           | 
 |  
 public void Run()
 {
 foreach (FileData f in FastDirectoryEnumerator.EnumerateFiles(_config.Queue.GetPickupFolderPath(), "*.EML").OrderBy(x => x.CreationTime))
 {
 _mailer.AddJob(f.Name, f.Path, true, null, null);
 if (_mailer.JobsPending.Count > 4096)
 {
 RunBatch();
 }
 }
 
 if (_mailer.JobsPending.Count > 0)
 {
 RunBatch();
 }
 }
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          One of the reasons why MailBee.NET Queue is shipped with the source code is that for such kind of software it's virtually impossible to implement all the settings needed (at least without turning the project into a real monster). To give people freedom of adjusting everything they need we provide sources. For instance, you're asking about sending eml files in the same order they are generated. Other ask to send them at particular time or at particular time windows or based on domain name of recipients or senders with different priority, and so on and on.
           | Posted: 09 January 2015 at 9:55am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  |