You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michael Täschner <m....@gmail.com> on 2016/10/06 06:43:29 UTC

Re: Camel-Mail - Consume from IMAP with variable searchTerm.fromSentDate

Hi Again,

is there a possibility that the searchTerm bean reference picked up by
camel-mail can update it's internal state to allow for a changing sentDate
for the query?

Thanks and Best Regards,
Michael

2016-09-23 16:21 GMT+02:00 Michael Täschner <m....@gmail.com>:

> Hi Camel-Riders,
>
> is there a possibility to consume mails with modifiable
> searchTerm.fromSentDate value? I am looking at a solution where the
> consumer must not depend on "unseen" flag, manages an internal dateTime
> variable to pick-up mail search from where it last stopped?  There may be
> other clients on the mail account and I cannot depend on the "unseen" flag.
> Is this a case for poll-enrich or how can I manipulate the from query to
> use the variable "searchTerm.fromSentDate"?
>
> Thanks and Best Regards,
> Michael
>

Re: Camel-Mail - Consume from IMAP with variable searchTerm.fromSentDate

Posted by Michael Täschner <m....@gmail.com>.
Hi Claus,

do you see a possibility that the MailConsumer can be extended to support
dynamic parameters? Especially SearchTerms like "SentDate" are rather
dynamic in nature - otherwilse mails will be polled over and over again if
other searchTerms like "unseen" cannot be applied.

Thanks and Best Regards,
Michael

2016-10-07 10:20 GMT+02:00 Michael Täschner <m....@gmail.com>:

> Unfortunately it is not sufficient to provide own SearchTerm class and
> overriding "match" because com.sun.mail.imap.protocol.SearchSequence
> checks specific implementations of SearchTerm provided by com.sun.mail and
> all implementations are final. I worked around the issue by resetting the
> searchTerm in Camel MailEndpoint everytime I want to update the criteria.
> This works as MailConsumer retrieves the searchTerm from the endpoint on
> each poll.
>
> 2016-10-06 13:21 GMT+02:00 Claus Ibsen <cl...@gmail.com>:
>
>> I think you just need to keep state yourself in the bean, and then the
>> mail component will call the match method to see if a mail messages
>> matches or not.
>>
>> Then your state can then update with new sent date information so the
>> matches method can use a newer date.
>>
>> On Thu, Oct 6, 2016 at 2:43 AM, Michael Täschner <m....@gmail.com>
>> wrote:
>> > Hi Again,
>> >
>> > is there a possibility that the searchTerm bean reference picked up by
>> > camel-mail can update it's internal state to allow for a changing
>> sentDate
>> > for the query?
>> >
>> > Thanks and Best Regards,
>> > Michael
>> >
>> > 2016-09-23 16:21 GMT+02:00 Michael Täschner <m....@gmail.com>:
>> >
>> >> Hi Camel-Riders,
>> >>
>> >> is there a possibility to consume mails with modifiable
>> >> searchTerm.fromSentDate value? I am looking at a solution where the
>> >> consumer must not depend on "unseen" flag, manages an internal dateTime
>> >> variable to pick-up mail search from where it last stopped?  There may
>> be
>> >> other clients on the mail account and I cannot depend on the "unseen"
>> flag.
>> >> Is this a case for poll-enrich or how can I manipulate the from query
>> to
>> >> use the variable "searchTerm.fromSentDate"?
>> >>
>> >> Thanks and Best Regards,
>> >> Michael
>> >>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>

Re: Camel-Mail - Consume from IMAP with variable searchTerm.fromSentDate

Posted by Michael Täschner <m....@gmail.com>.
Unfortunately it is not sufficient to provide own SearchTerm class and
overriding "match" because com.sun.mail.imap.protocol.SearchSequence checks
specific implementations of SearchTerm provided by com.sun.mail and all
implementations are final. I worked around the issue by resetting the
searchTerm in Camel MailEndpoint everytime I want to update the criteria.
This works as MailConsumer retrieves the searchTerm from the endpoint on
each poll.

2016-10-06 13:21 GMT+02:00 Claus Ibsen <cl...@gmail.com>:

> I think you just need to keep state yourself in the bean, and then the
> mail component will call the match method to see if a mail messages
> matches or not.
>
> Then your state can then update with new sent date information so the
> matches method can use a newer date.
>
> On Thu, Oct 6, 2016 at 2:43 AM, Michael Täschner <m....@gmail.com>
> wrote:
> > Hi Again,
> >
> > is there a possibility that the searchTerm bean reference picked up by
> > camel-mail can update it's internal state to allow for a changing
> sentDate
> > for the query?
> >
> > Thanks and Best Regards,
> > Michael
> >
> > 2016-09-23 16:21 GMT+02:00 Michael Täschner <m....@gmail.com>:
> >
> >> Hi Camel-Riders,
> >>
> >> is there a possibility to consume mails with modifiable
> >> searchTerm.fromSentDate value? I am looking at a solution where the
> >> consumer must not depend on "unseen" flag, manages an internal dateTime
> >> variable to pick-up mail search from where it last stopped?  There may
> be
> >> other clients on the mail account and I cannot depend on the "unseen"
> flag.
> >> Is this a case for poll-enrich or how can I manipulate the from query to
> >> use the variable "searchTerm.fromSentDate"?
> >>
> >> Thanks and Best Regards,
> >> Michael
> >>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: Camel-Mail - Consume from IMAP with variable searchTerm.fromSentDate

Posted by Claus Ibsen <cl...@gmail.com>.
I think you just need to keep state yourself in the bean, and then the
mail component will call the match method to see if a mail messages
matches or not.

Then your state can then update with new sent date information so the
matches method can use a newer date.

On Thu, Oct 6, 2016 at 2:43 AM, Michael Täschner <m....@gmail.com> wrote:
> Hi Again,
>
> is there a possibility that the searchTerm bean reference picked up by
> camel-mail can update it's internal state to allow for a changing sentDate
> for the query?
>
> Thanks and Best Regards,
> Michael
>
> 2016-09-23 16:21 GMT+02:00 Michael Täschner <m....@gmail.com>:
>
>> Hi Camel-Riders,
>>
>> is there a possibility to consume mails with modifiable
>> searchTerm.fromSentDate value? I am looking at a solution where the
>> consumer must not depend on "unseen" flag, manages an internal dateTime
>> variable to pick-up mail search from where it last stopped?  There may be
>> other clients on the mail account and I cannot depend on the "unseen" flag.
>> Is this a case for poll-enrich or how can I manipulate the from query to
>> use the variable "searchTerm.fromSentDate"?
>>
>> Thanks and Best Regards,
>> Michael
>>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2