You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gary <ga...@ge.com> on 2015/02/24 22:15:31 UTC

camel blueprint support multiple mail boxes ???

Hello, ( yeah, wish I wasn't but I am... boy I missed out on a lot :). 

hey, I am new to apache camel fuse serviceMix, etc...

I have an immediate problem I need help solving, and thanks to all. 

currently, the configuration I am working on uses blueprint.xml for its
default settings and some of its tag:attribute parameters can be overridden
with the addition of a .cfg file.  Right now I have a single email server, a
single mail box, where all emails from multiple clients are coming in to. I
have a need to have individual mail boxes to pull/download/consume messages
from instead of just a single mail box. How is this done? Can this be done?
is it the wrong implementation, etc... 

I need say 10 to 15 individual mail boxes, each customer would be assigned
their own mail box to send their messages to.  Then to simply be able to
configure the .xml endpoints and routes with these additional mail boxes.   

THANKS!!!
---------------------
/OSGI-INF/blueprint/blueprint.xml
      <cm:property name="mail.username" value="" />
      <cm:property name="mail.password" value="" />
      <cm:property name="mail.delete" value="false" />
      <cm:property name="mail.pop3.forgettopheaders" value="false" />


      <cm:property name="sftp.hostname" value="" />
      <cm:property name="sftp.port" value="22" />
      <cm:property name="sftp.username" value="" />
      <cm:property name="sftp.password" value="" />
      <cm:property name="sftp.attachmentsPath" value="/tmp/attachments" />
      <cm:property name="sftp.path" value="/temp" />
      <cm:property name="sftp.recursive" value="false" />
      <cm:property name="sftp.move" value=".camel" />
      <cm:property name="ftp.readLock" value="changed"/>
      <cm:property name="target.folder" value="/tmp/mailProcessor/target" />

    </cm:default-properties>
  </cm:property-placeholder>
  

  <camelContext id="my_blueprintContext" trace="false"
xmlns="http://camel.apache.org/schema/blueprint">

    
    <endpoint id="emailServer"
uri="{{mail.protocol}}://{{mail.hostname}}?username={{mail.username}}&amp;password={{mail.password}}&amp;delete={{mail.delete}}&amp;mail.pop3.forgettopheaders={{mail.pop3.forgettopheaders}}"
/>
    <endpoint id="sftpServerAttachmentsFolder"
uri="sftp:{{sftp.username}}@{{sftp.hostname}}:{{sftp.port}}/{{sftp.attachmentsPath}}?password={{sftp.password}}"
/>
    <endpoint id="sftpServer"
uri="sftp:{{sftp.username}}@{{sftp.hostname}}:{{sftp.port}}/{{sftp.path}}?password={{sftp.password}}&amp;move={{sftp.move}}&amp;recursive={{sftp.recursive}}&amp;readLock={{sftp.readLock}}"
/>
    

    
    <route id="popToMailProcessor" autoStartup="true">
      <from id="exchangeMailServer" ref="emailServer" />
      <log message="Received email - subject: ${header.subject}" />
      <log loggingLevel="DEBUG" message="Processing Attachments:
${header.subject}" />
      <camel:process id="attachmentToLocalFileProcessor" ref="mailProcessor"
/>
      
    </route>
    

    
    <route id="attachmentsToSFTP" autoStartup="true">
      <from id="localAttachmentFiles"
uri="file:{{mailProcessorBean.attachmentFolder}}" />
      <log loggingLevel="DEBUG" message="Attachment to SFTP:
${file:onlyname}" />
      <to id="sftpAttachmentsTarget" ref="sftpServerAttachmentsFolder" />
    </route>
    

    
    <route id="sftpToLocalFile" autoStartup="true">
      <from id="sftpSource" ref="sftpServer" />
      <log loggingLevel="DEBUG" message="SFTP to Windows Share:
${file:absolute.path}" />
      <to id="windowsShareTarget" uri="file://{{target.folder}}" />
    </route>
    

  </camelContext>

</blueprint>
----------------
view com.ge.ip.infra.cfg
mailProcessorBean.attachmentFolder=/app/attachments/


mail.protocol=pop3s
#pop3s and pop3 are the available protocols
mail.hostname=3.159.212.217
mail.port=995
#defaults to 110

mail.username=GeneralEmail@my.com
mail.password=Test123test

#Deleting pop3 email after receiving to prevent redelivery from Exchange
mail.delete = true

sftp.hostname=sftp.corporate.my.com
sftp.port=10022
sftp.attachmentsPath=/myFTPpath
#Path to deposit email attachments on the SFTP server
sftp.path=/
#Path to pick up from for transfer to the Windows server
sftp.username=GManOne
sftp.password=password123!

# recursion is set to false by default
sftp.recursive=true
# subdirectory to move file into after processing
sftp.move=.moved
# Ensures files are not pulled from the FTP server before the entire file is
written
sftp.readLock=changed
#Path on the Fuse server mounted to the Windows server using SMB
target.folder=/targetFolder




--
View this message in context: http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel blueprint support multiple mail boxes ???

Posted by yogu13 <yo...@gmail.com>.
The xml DSL also supports multiple entries Of routes but that would be
fairly static. Java DSL gives you the flexibility and dynamism for building
the route.

Hope this answers your question.

Regards,
-Yogesh

On Wednesday, February 25, 2015, Gary [via Camel] <
ml-node+s465427n5763168h37@n5.nabble.com> wrote:

> Hi Yogu13,
>
> thanks!!!
> ok, I think I get it, if I use the Java DSL I have more scalability
> because the config files or the xml's do not support multiple configuration
> entries??? Sorry if I am a bit behind, learning on overload, arg!
>
> thanks again,
> Gary
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126p5763168.html
>  To unsubscribe from camel blueprint support multiple mail boxes ???, click
> here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5763126&code=eW9ndTEzQGdtYWlsLmNvbXw1NzYzMTI2fC04ODQzODQxMjM=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126p5763178.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel blueprint support multiple mail boxes ???

Posted by Gary <ga...@ge.com>.
Thanks again Yogu13!!! got it:). have a great day and thanks for responding
so quickly and being helpful. 

appreciate your help.





--
View this message in context: http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126p5763234.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel blueprint support multiple mail boxes ???

Posted by Gary <ga...@ge.com>.
Hi Yogu13, 

thanks!!! 
ok, I think I get it, if I use the Java DSL I have more scalability because
the config files or the xml's do not support multiple configuration
entries??? Sorry if I am a bit behind, learning on overload, arg!

thanks again,
Gary



--
View this message in context: http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126p5763168.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel blueprint support multiple mail boxes ???

Posted by yogu13 <yo...@gmail.com>.
Hello Gary,

>From what i understand about your problem creating / configuring dynamic
routes using RouteBuilder (Java DSL) should simplfy things for you, Assuming
that you list of mailboxes is only configured in the configuration file can
vary over a period of time.

example @
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/AddRoutesAtRuntimeTest.java

Hope this helps!

Regards,
-Yogesh



--
View this message in context: http://camel.465427.n5.nabble.com/camel-blueprint-support-multiple-mail-boxes-tp5763126p5763141.html
Sent from the Camel - Users mailing list archive at Nabble.com.