Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retrieving email using imaps is slow

User_IE3VOJan 24 2022

Hi,
I am using javamail to retrieve incoming mails. With the below code it's taking 4.5 to 5 sec to receive 23 emails.
To connect to the store it's taking 3.5 to 4 seconds.
I have checked with thunderbird, mails receive in milli seconds.
Is there a way to reduce time?
How much time does it take usually to receive 25 mails using imaps?

  Properties properties = new Properties();
                properties.put("mail.store.protocol", "imaps");
                properties.put("mail.host", host);
                properties.put("mail.port", "993");
//                properties.put("mail.imaps.fetchsize", "3000000");
                properties.put("mail.imaps.ssl.enable", "true");
                Session emailSession = Session.getInstance(properties);
                Store store = emailSession.getStore("imaps");
                if(!store.isConnected()){
                    System.out.println("not connected");
                    store.connect(username, pwd);//Here takes 3.5 to 4 seconds
                    System.out.println("time taken store connect: "+System.currentTimeMillis());
                }System.out.println("connected");

                // create the folder object and open it
                Folder emailFolder =store.getFolder("INBOX");
                emailFolder.open(Folder.READ_WRITE);

                FetchProfile fp = new FetchProfile();
                fp.add(FetchProfile.Item.ENVELOPE);
                fp.add(IMAPFolder.FetchProfileItem.FLAGS);
                fp.add(IMAPFolder.FetchProfileItem.CONTENT_INFO);
                fp.add(UIDFolder.FetchProfileItem.UID);

        emailFolder.fetch(emailFolder.getMessages(), fp); // Load the profile of the messages in 1 fetch.
//        emailFolder.doCommand(new CustomProtocolCommand(start, end));
                for (final Message message : emailFolder.getMessages()) {
                    System.out.println("message"+message.getSubject());//Here takes 4.5 to 5 seconds
                    System.out.println("time taken message: "+System.currentTimeMillis());
                }

Comments

Ibag

Hi Dilek,

The fragmentation content is basically nothing but partition of tables in Physical Database. When we have data partioned in tables or data available in different tables( some transcations might store in different tables), we will use fragmentation in OBIEE. Ideally we do go with physical partition.

Better go through Nico's blog for better understanding.

OBIEE - Fragmentation Content, value-based, horizontal partitioning | GerardNico.com (BI, OBIEE, OWB, DataWarehouse)

Gianni Ceresa

Hi Dilek,

For the content level you must read a single blog: https://greatobi.wordpress.com/2013/09/10/the-single-most-important-thing-to-know-about-the-obi-rpd/

Content level is a core element of OBIEE, it tell the system at which levels things exists and how to manipulate them at that level, above or below it.

It's of course related to hierarchies and that's why you must always build hierarchies for each one of your dimensions (even if the system allow you to not do it and there are still lot of people saying it's not important ... they just still didn't get how OBIEE works).

For the fragmentation just keep in mind it's limited: often it doesn't match the condition and the system uses both LTS just because the column used in the fragmentation rule isn't in the analysis. There are also some issues when using time series functions on a fragmented time dimension.

But what you ask are some of the most core elements of OBIEE and also the most complicated to understand and it's why many "experts" still didn't got what content level are ....

So take your time also to try and test these things having a look at the generated SQL as they have a direct impact on that.

asim cholas

Fragmentation is something like we are splitting the table in to multiple fragments for faster and better query performance.

For example you are working in a large organization with 1 million employees. you have all your employee data in one table called employee. When you are querying for the details of dileraco, the query will scan whole table until it finds the value for dileraco. So it can have performance impact. In fragmentation what we do is , for employee table, employee name starting with A you will create a different partition, for B another, So when you query for dileraco it will hit the "D" Partition which will have much lesser records than the actual table. So query performance will be better. this is value based partitioning. you can partition table in multiple ways, like first 10000 records in 1st partition and so on. Hope you got some idea about fragmentation.

Thanks

Aj

1 - 3

Post Details

Added on Jan 24 2022
0 comments
239 views