Discussion:
How can i configure dynamic FTP End Points in Mule ?
partha
2012-08-21 09:13:08 UTC
Permalink
Hi David,
<br /><br />
I am trying to retrieve FTP connection details from Database. It is giving extra sybols along with the data. Please let me know how to remove this special characters.
<br /><br />
Configuration XML
<br /><br />
<code>
<br /><br />
&lt;flow name=&quot;dynamicjdbc2Flow1&quot; doc:name=&quot;dynamicjdbc2Flow1&quot;&gt;
<br />
&lt;jdbc:inbound-endpoint exchange-pattern=&quot;one-way&quot; queryKey=&quot;DSQuery&quot; queryTimeout=&quot;-1&quot; pollingFrequency=&quot;1000&quot; connector-ref=&quot;Database__JDBC_&quot; doc:name=&quot;Database (JDBC)&quot;&gt;&lt;jdbc:query key=&quot;DSQuery&quot; value=&quot;SELECT &amp;quot;User&amp;quot;,&amp;quot;Password&amp;quot;,&amp;quot;Host&amp;quot;, &amp;quot;Port&amp;quot;,&amp;quot;Path&amp;quot; FROM &amp;quot;User&amp;quot;; &quot;&#47;&gt;
<br />
&lt;&#47;jdbc:inbound-endpoint&gt;&lt;scripting:component doc:name=&quot;Groovy&quot;&gt;
<br />
&lt;scripting:script engine=&quot;Groovy&quot;&gt;
<br />
&lt;scripting:text&gt;&lt;![CDATA[def ftpFileUri = &quot;ftp:&#47;&#47;${payload&#46;User}:${payload&#46;Password}@${payload&#46;Host}:${payload&#46;Port}${payload&#46;Path}&quot;muleContext&#46;client&#46;request(ftpFileUri,30000L);println ftpFileUri;]]&gt;
<br />
&lt;&#47;scripting:text&gt;
<br />
&lt;&#47;scripting:script&gt;
<br />
&lt;&#47;scripting:component&gt;
<br />
&lt;&#47;flow&gt;
<br /><br />
</code>
<br /><br />
Output
<br /><br />
ftp://anonymous%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20:<a href="mailto:anonymous%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-***@public.gmane.org" rel="nofollow">anonymous%20%20%20%20%20%20%20%20%20%...</a>%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20:21/Partha, connector=FtpConnector
<br /><br />
Thanks
<br />
Partha

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
David Dossot
2012-08-21 14:37:09 UTC
Permalink
Have you checked the data in the database?
<br /><br />
I think you'd need to have these %20 in the DB to have them printed out from the script, as I don't see any URL encoding of ftpFileUri being done (which would turn spaces into %20).

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
partha
2012-08-21 15:21:08 UTC
Permalink
Thanks David. I checked the Database.There are extra spaces in DB. Dut to this %20 is coming in the output.
<br /><br />
Please let me know how to code to supress this spaces from mule side. I have mentiond my groovy script in the above conversation.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Fake David Dossot
2012-08-21 16:00:08 UTC
Permalink
Let's hope the usernames/passwords don't start or end with spaces...
<br /><br />
Use: ${payload.User.trim()} and ${payload.Password.trim()}

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
partha
2012-08-22 06:25:09 UTC
Permalink
Thanks David.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...