You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "julian+activemq@dotr.com" <ju...@dotr.com> on 2011/08/22 09:04:31 UTC

Teach a man to fish ..

I have been trying all weekend now to achieve what I thought would be a
simple task.

I want to poll my gmail account, retrieve any unread messages (leaving them
on the account) and send the message to an ActiveMQ queue.

I have got so far as to get camel to attempt to load the smtps "thing", but
the log complains about 

" Failed to create route route1: ..... [snip] ...  due to: No component
found with scheme: smtps"

I have run into a wall so many times this weekend that I am about to give
up. :(

All morning I have read up on how to install components (I still have no
idea) and worst still, where the bloody hell do I a) get the component, b)
install it and c) get it to load into camel ? 

I *think* that I need camel-mail.jar

Please, please, I am begging someone to show me step by step what is
required and how to achieve it in order for me to understand the steps and
processes required.

thanks , from one very frustrated old man ;)


--
View this message in context: http://camel.465427.n5.nabble.com/Teach-a-man-to-fish-tp4722377p4722377.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Teach a man to fish ..

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Aug 23, 2011 at 8:28 AM, julian+activemq@dotr.com
<ju...@dotr.com> wrote:
> we have (limited) success !!
>
> Thanks very much - I can now receive plain text emails from google.
>
> 1) I had to download the springsource framework and put all of the .jar
> files into the "optional" directory as well
> 2) some of the demo parameters have changed since camel 2.0. These include
> "deleteProcessedMessages" now "delete" and "processOnlyUnseenMessages" now
> "unseen"

Must be some old demo. What demo do you refer to?

You can see the mail component options here
http://camel.apache.org/mail.html

>
> However, my stomp client only gets the headers and properties for email with
> a header of "Content_HYPHEN_Type:multipart/alternative; " for plain text
> email, I get the full body.
>

The JMS spec is limited in what you can send and has restrictions on
key names for JMS properties.
You cannot use a - sign, so Camel will by default convert - to
_HYPHEN_. On the consumer side you would have to restore this, as you
are not using Camel.

If you dont want this to happen by Camel you can configure a different
key format strategy, using the option: jmsKeyFormatStrategy
You can read more about this at
http://camel.apache.org/jms



> I presume that this is something to do with plaintext vs binary in the stomp
> message, but how do I get MQ to send a binary stomp message to a client ?
>

A multipart mail message is all text based, the content is text based
encoded in the mail.

For stomp and AMQ questions then I would suggest to try the AMQ
mailing list also.


> Many thanks for the help so far. Impossible to have done this without the
> help.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Teach-a-man-to-fish-tp4722377p4725645.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Teach a man to fish ..

Posted by "julian+activemq@dotr.com" <ju...@dotr.com>.
we have (limited) success !!

Thanks very much - I can now receive plain text emails from google. 

1) I had to download the springsource framework and put all of the .jar
files into the "optional" directory as well
2) some of the demo parameters have changed since camel 2.0. These include
"deleteProcessedMessages" now "delete" and "processOnlyUnseenMessages" now
"unseen"

However, my stomp client only gets the headers and properties for email with
a header of "Content_HYPHEN_Type:multipart/alternative; " for plain text
email, I get the full body.

I presume that this is something to do with plaintext vs binary in the stomp
message, but how do I get MQ to send a binary stomp message to a client ?

Many thanks for the help so far. Impossible to have done this without the
help.

--
View this message in context: http://camel.465427.n5.nabble.com/Teach-a-man-to-fish-tp4722377p4725645.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Teach a man to fish ..

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Aug 22, 2011 at 10:41 AM, julian+activemq@dotr.com
<ju...@dotr.com> wrote:
> Claus, thanks for the pointers !
>
> However, I still don't know where to get camel-mail.jar from. Is there a
> components download area that I am just not seeing ?
>

You can download it from maven central
http://repo2.maven.org/maven2/org/apache/camel/camel-mail/

Or download Apache Camel ZIP file that has all the components
http://camel.apache.org/download

Mind that you should use the same version of the Camel JAR that
ActiveMQ is already using.
For example Apache ActiveMQ 5.5.0 uses Apache Camel 2.7.0.

So in that case you should use Camel 2.7.0 version.




> I am running the standalone activemq server, with the built-in camel.
>
> The maven dependecy xml should be put into
>
> ./webapps/camel/META-INF/maven/org.apache.camel/camel-web/pom.xml
>
> right ?

No the maven dependency is only usable if you develop projects and you
use Apache Maven.
In your case you should not need it.

>
> and the maven jar should be placed in lib as well ?

No.

The camel-mail JAR + the mail JAR should be placed in there.


>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Teach-a-man-to-fish-tp4722377p4722593.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Teach a man to fish ..

Posted by "julian+activemq@dotr.com" <ju...@dotr.com>.
Claus, thanks for the pointers !

However, I still don't know where to get camel-mail.jar from. Is there a
components download area that I am just not seeing ?

I am running the standalone activemq server, with the built-in camel.

The maven dependecy xml should be put into 

./webapps/camel/META-INF/maven/org.apache.camel/camel-web/pom.xml

right ?

and the maven jar should be placed in lib as well ?

Thanks

--
View this message in context: http://camel.465427.n5.nabble.com/Teach-a-man-to-fish-tp4722377p4722593.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Teach a man to fish ..

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

On Mon, Aug 22, 2011 at 9:04 AM, julian+activemq@dotr.com
<ju...@dotr.com> wrote:
> I have been trying all weekend now to achieve what I thought would be a
> simple task.
>
> I want to poll my gmail account, retrieve any unread messages (leaving them
> on the account) and send the message to an ActiveMQ queue.
>
> I have got so far as to get camel to attempt to load the smtps "thing", but
> the log complains about
>

For polling an existing mail account you would need to use a mail
protocol for polling mails which would be either one of
- pop3
- imap

The stmp is for *sending* emails only. So change the endpoint uri to
use for example imap



> " Failed to create route route1: ..... [snip] ...  due to: No component
> found with scheme: smtps"
>
> I have run into a wall so many times this weekend that I am about to give
> up. :(
>
> All morning I have read up on how to install components (I still have no
> idea) and worst still, where the bloody hell do I a) get the component, b)
> install it and c) get it to load into camel ?
>
> I *think* that I need camel-mail.jar
>

Yes when you use a Camel component you need to install the JARs needed.

On this page
http://camel.apache.org/components

There is a artifactId listed next to the component name. So for mail
it says: camel-mail.

Likewise on the documentation page for the component in question, we
often have a Maven dependency listed
http://camel.apache.org/mail.html

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-mail</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>


Are you running Apache ActiveMQ standalone and want to use the
embedded Camel inside it?
If so you would need to copy camel-mail JAR to the activemq/lib
directory (eg the lib directory in the AMQ installation).
There is already some Camel JARs in there.

On top of that you would also need the Mail JAR
 javax.mail:mail:jar:1.4.4:compile

You can download that JAR from the maven repo
http://repo2.maven.org/maven2/javax/mail/mail/1.4.4/






> Please, please, I am begging someone to show me step by step what is
> required and how to achieve it in order for me to understand the steps and
> processes required.
>
> thanks , from one very frustrated old man ;)
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Teach-a-man-to-fish-tp4722377p4722377.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/