• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFIMAP running very slowly since Java Update

New Here ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

We have a scheduled task that scrubs an inbox regularly and has been running like clockwork since January 2022. This sunday our IT team updated the JDK to 11.0.6 and it started timing out. I've cut the task down to the bare bones and is it still taking multiple minutes to load a single email. I wanted to know if anyone else is experiencing anything like this.

 

Our CF version: 2018.0.14.330003

The pared down code for the scheduled task:

<cfparam name="url.folder" default="inbox"/>
<cfparam name="url.maxrows" default="10"/>
<cfparam name="url.startRow" default="1"/>
<cftry>

	<cfset local.email_username = [USER_NAME] />
	<cfset local.email_password = [USER_PASS] />

	<cfimap  
		action="open"
	        server="imap.gmail.com"
		port="993"
		username="#local.email_username#"
		password="#local.email_password#"
		secure="yes" 
	        connection = "test.cf.gmail" />

	<!--- get all messages from IMAP server --->
	<cfimap
		action="getAll"
		maxrows="#url.maxrows#"
		startRow="#url.startRow#"
		name="emails"
		folder="#url.folder#"
		connection="test.cf.gmail" />

	<cfdump var="#emails#" />

	<cfcatch>
		<cfdump var="#cfcatch#" />
	</cfcatch>
</cftry>

<cftry>
<!--- close the connection --->
	<cfimap
		action="close"
		connection="test.cf.gmail" />

	<cfcatch>
		<cfdump var="#cfcatch#" />
	</cfcatch>
</cftry>

 

Views

149

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2022 Sep 28, 2022

Copy link to clipboard

Copied

There's not any known issue (that I know of) about that combo, if you're wondering first about that.

 

But you say you're running 11.0.6. Did you really mean that? Or 11.0.16 (released in July?) If not the latter, have you considered updating your jvm?

 

Since you're using "secure" for the cfimap, this could indeed be a JVM (rather than a cf) problem. See this post of mine on the matter:

 

https://coldfusion.adobe.com/2019/06/error-calling-cf-via-https-solved-updating-jvm/

 

Let us know if it helps or not. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2022 Oct 01, 2022

Copy link to clipboard

Copied

Jeffrey, any update? 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

Hi @jeffreyk34520003 ,

How long does your code take?

To measure the execution time, you could place the line

 

<cfset startTime=getTickCount()>

 

at the beginning, and the following line at the end

 

<!--- Store mail-fetch times in mailFetchTimes.html within current folder. ---> 
<cfdump var="#getTickCount()-startTime#" label="Total time to get mail" format="html" output="#expandPath('mailFetchTimes.html')#">

 

 I ran your code on ColdFusion 2018.0.14 + JDK11.0.16, changing just the values for username and password. It took consistently 7 seconds to fetch the mail. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2022 Oct 05, 2022

Copy link to clipboard

Copied

LATEST

Some suggestions:

  1. Make sure that the JDK that your IT team installed is actually the one ColdFusion is using. Verify the java.home value in /bin/jvm.config.
  2.  Check the contents of /bin/jvm.config to ensure that TLS 1.x is not allowed (one of the many suggestions in the link Charlie has provided)
  3.  Open CMD (assuming Windows) on the server on which CF is running, and run the DOS command ping -a imap.gmail.com

Make sure the connection to the gmail server is not impeded in anyway.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation