You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by camrider <sm...@gmail.com> on 2016/03/18 15:51:39 UTC
Activity feeds and email notifications
I am new to Camel and have immersed myself in lots of tutorials and examples,
but I still can't seem to get what I want with regards to implementing from
scratch an activity feed. Camel was recommended in a response to
http://stackoverflow.com/questions/16861026/need-a-framework-for-a-notification-dashboard-system
, and an answer says:
You would first create a topic to which you post messages. Then when a user
registers for email notifications, you would add an email endpoint for
him/her. And when they opt-out of Email, you will remove that endpoint.
I would like the last n (say 10) events stored with the user to represent an
activity feed, but also have an email (optionally) sent on the event if the
user subscribes to it. For example the system has Projects and Users, and
Users can choose to follow a Project so they will be notified of a Project
status change in their feed and optional email message sent.
I have installed JBoss Fuse Integration in Eclipse to try and make some sort
of diagram of this, but I don't think I can represent the dynamic management
of endpoints as described in a static diagram. Unless I use a pattern like
Recipient List? If so then how do I dynamically create the list? With a
custom processor?
The other thing I want to know is what goes in the message that is being
routed? Can the original message/event contain only a Project id and then
Camel components can lookup the object and do queries to find the rest of
the information, like Project details, followers, and their User details
like email address? Or should all that information be gathered up front so
that components can be configured with no need to access external resources
(like a database)?
--
View this message in context: http://camel.465427.n5.nabble.com/Activity-feeds-and-email-notifications-tp5779279.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Activity feeds and email notifications
Posted by "Walzer, Thomas" <th...@integratix.net>.
You do not need hundreds of endpoints to send to hundreds of email recipients.
You just need one endpoint (smtp). This one is configured for your smtp host.
Then you vary only the mail recipients in a header value.
> Am 21.03.2016 um 16:03 schrieb camrider <sm...@gmail.com>:
>
> I think I'm misunderstanding how recipientList is being used. I want to send
> an email message to an arbitrary number of Users (e.g. tens) based on a
> change/message from hundreds of Projects. Should I be dynamically
> adding/removing endpoints for hundreds of project-users? The recipient list
> pattern is for dynamically specifying the route (out of hundreds) to take?
>
> Maybe I should be doing something with Splitter instead?
>
> In the end, I start with one message and multiply it to tens of messages
> that have endpoints that notify the users. I don't understand the line
> between configuring components and writing code to access the database, etc.
> that provides all the logic on who gets notified.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Activity-feeds-and-email-notifications-tp5779279p5779417.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Activity feeds and email notifications
Posted by camrider <sm...@gmail.com>.
I think I'm misunderstanding how recipientList is being used. I want to send
an email message to an arbitrary number of Users (e.g. tens) based on a
change/message from hundreds of Projects. Should I be dynamically
adding/removing endpoints for hundreds of project-users? The recipient list
pattern is for dynamically specifying the route (out of hundreds) to take?
Maybe I should be doing something with Splitter instead?
In the end, I start with one message and multiply it to tens of messages
that have endpoints that notify the users. I don't understand the line
between configuring components and writing code to access the database, etc.
that provides all the logic on who gets notified.
--
View this message in context: http://camel.465427.n5.nabble.com/Activity-feeds-and-email-notifications-tp5779279p5779417.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Activity feeds and email notifications
Posted by "Walzer, Thomas" <th...@integratix.net>.
Hi,
not sure if I got your requirements right, but a few ideas:
the static diagrams may make it difficult to see the dynamic options in camel/activemq
make a recipientlist where you send to various topics suited to your needs
read up on various features of activemq: wildcards, composite destinations, …
be careful with topics in activemq
test it
test harder
A camel exchange can contain any Java object. You could route only your project id and then look up the content later. Or you can choose to include everything in the first place. The choice is yours.
You can populate the recipientList for instance by setting a header:
from("direct:a")
.recipientList(header("foo"));
for instance if header „foo" contains „jms:topic:projectA“ your exchange will be routed to a jms topic named projectA.
You can set your header dynamically based on something in your input data. You a completely free.
Cheers, Thomas.
> Am 18.03.2016 um 15:51 schrieb camrider <sm...@gmail.com>:
>
> I am new to Camel and have immersed myself in lots of tutorials and examples,
> but I still can't seem to get what I want with regards to implementing from
> scratch an activity feed. Camel was recommended in a response to
> http://stackoverflow.com/questions/16861026/need-a-framework-for-a-notification-dashboard-system
> , and an answer says:
> You would first create a topic to which you post messages. Then when a user
> registers for email notifications, you would add an email endpoint for
> him/her. And when they opt-out of Email, you will remove that endpoint.
>
> I would like the last n (say 10) events stored with the user to represent an
> activity feed, but also have an email (optionally) sent on the event if the
> user subscribes to it. For example the system has Projects and Users, and
> Users can choose to follow a Project so they will be notified of a Project
> status change in their feed and optional email message sent.
>
> I have installed JBoss Fuse Integration in Eclipse to try and make some sort
> of diagram of this, but I don't think I can represent the dynamic management
> of endpoints as described in a static diagram. Unless I use a pattern like
> Recipient List? If so then how do I dynamically create the list? With a
> custom processor?
>
> The other thing I want to know is what goes in the message that is being
> routed? Can the original message/event contain only a Project id and then
> Camel components can lookup the object and do queries to find the rest of
> the information, like Project details, followers, and their User details
> like email address? Or should all that information be gathered up front so
> that components can be configured with no need to access external resources
> (like a database)?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Activity-feeds-and-email-notifications-tp5779279.html
> Sent from the Camel - Users mailing list archive at Nabble.com.