mysql - Throttling Mule Messages in Mule -
i've polling process in mule queries mysql database every 30 seconds , sends email recipient. how limit sending 1 email regardless of polling cycle whether 30 seconds or 15 seconds? i'm open counter in mysql db if that's option.
thank you.
write condition send email if emailsentflag == false.
use choice router create condition, , objectstore hold emailsentflag value.
<flow...> .... <objectstore:retrieve config-ref="objectstore__configuration" key="emailsentflag" defaultvalue-ref="#[false]" targetproperty="flowvars.emailsentflag" doc:name="retrieve emailsentflag"/> <choice doc:name="isemailsent?"> <when expression="#[flowvars.emailsentflag == true]"> <logger level="info" doc:name="log email sent"/> </when> <otherwise> <smtp:outbound-endpoint host="" user="" password="" to="" from="" subject="test" cc="" bcc="" replyto="" responsetimeout="10000" ref="gmail" doc:name="smtp" connector-ref="gmail"/> <objectstore:store config-ref="objectstore__configuration" key="emailsentflag" value-ref="#[true]" doc:name="store emailsentflag"/> </otherwise> </choice> </flow>
also explore ttl , persistence feature of objectstore, useful you.
cheers
Comments
Post a Comment