Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-04-2011, 12:37 PM
Starter Member
 
Posts: 2
Default [SOLVED] Is Soap faster than zmmailbox?

Hi!

I've written a little zimlet that works, but takes a while to run. I suspect I could make it faster by using the SOAP interface instead of a command-line search, but I'm having trouble finding any example zimlets which do something similar to my project. I'm hoping someone can point me toward a zimlet that does the equivalent of a "zmmailbox search" command with SOAP.

The Zimlet is pretty straightforward. It loads automatically and sends out an ajax request to a jsp script. The JSP builds a zmmailbox search command and runs it using Java's Runtime.exec method. This approach works, but on my test box the command takes about 30 seconds. It'll be a bit snappier on our production server, but if each login of our 10,000ish userbase results in 2 new Java threads and corresponding AJAX requests, I predict a noticeable hit in server performance, so...

My Question is whether a SOAP (or REST) query would be less resource intensive than a zmmailbox search command, and if so, could someone please point me toward a zimlet that does a similar query. I get the general idea of SOAP, but I'm fuzzy on how exactly I would implement my query in a zimlet.

I've attached the complete zimlet, in case that helps, or the code is up on github. The jsp file is called 35.jsp. As an aside, is there any way to tell zimbra to recompile JSP when a zimlet is loaded through the ?dev=1 mode? Renaming the file gets a bit tedious after a while.

Thanks,
Joe
Attached Files
File Type: gz janitor.tar.gz (2.3 KB, 3 views)

Last edited by joechrysler; 04-05-2011 at 07:42 PM..
Reply With Quote
  #2 (permalink)  
Old 04-12-2011, 07:25 AM
Starter Member
 
Posts: 2
Default

Update: I found an example zimlet that does a simple search for incomplete task items using Zimbra's Javascript API. After a little bit of fiddling, I convinced it to run a search on email messages instead of tasks. The new zimlet runs in something like 0.7 seconds and doesn't even cause a blip in server performance. The whole zimlet (all four files of it) is up on github for anyone to peruse, in case it might be helpful to somebody.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.