You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by srimin <sr...@gmail.com> on 2011/07/18 16:42:36 UTC

EIP pattern for blocking messages or delaying messages

Hi

I have a queue on which i'd like to receive JMS messages.
I should start delivering the  messages to an endpoint during working hours
9.00AM to 12.00PM
I was wondering if there is any EIP pattern that could be helpful in
achieving it.

bw
srim 


--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4599813.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EIP pattern for blocking messages or delaying messages

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

Please check out

http://camel.apache.org/delayer.html http://camel.apache.org/delayer.html 
http://camel.apache.org/message-filter.html
http://camel.apache.org/message-filter.html 

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4600123.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EIP pattern for blocking messages or delaying messages

Posted by srimin <sr...@gmail.com>.
Hi

<bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/>

Is this bean definition  mandatory for the CronScheduler?

rgds
srimin

--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4666466.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EIP pattern for blocking messages or delaying messages

Posted by Magnus Palmér <ma...@gmail.com>.
0 0/10 13 * * ? tells Quartz to trigger att 13:10, 13:20, 13:30, 13:40 and
13:50
You need a stop route as well

I use the Java DSL and use both the policy.setRouteStartTime and
policy.setRouteStopTime
Should be same for Spring XML DSL.

To start at 13:10 and end at 13:50 you need
CronExpression Start:
0 10 13 * * ?
CronExpressionStop:
0 50 13 * * ?

/Magnus
2011/8/4 srimin <sr...@gmail.com>

> Hi
>
> Is n't it that the routeStartTime
> 0 0/10 13 * * ?
>
> tells to start at 13:00 hours and it stops at 13:50 every day.
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4666433.html
>  Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: EIP pattern for blocking messages or delaying messages

Posted by srimin <sr...@gmail.com>.
Hi

Is n't it that the routeStartTime 
0 0/10 13 * * ?

tells to start at 13:00 hours and it stops at 13:50 every day.

--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4666433.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EIP pattern for blocking messages or delaying messages

Posted by Willem Jiang <wi...@gmail.com>.
How do you stop the route ?
The myroute route will keep running until you stop the route from the 
camel context.
On 8/1/11 6:10 PM, srimin wrote:
> Hi
>
>
> using FuseESB- apache-servicemix-4.4.0-fuse-00-43
>
>
> 'myroute'  should be opened from 13.00 to 13:50, but i see the messages are
> pumping in every minute
> as if there is no routePolicy applied.
>
>
> myroute.xml looks like this
>
>
>
>> <bean id="startPolicy"
>> class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
>>      <property name="routeStartTime" value="0 0/10 13 * * ?"/>
>> </bean>
>>
>> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> 	<route id="r1"  startupOrder="1">
>> 		<from uri="timer://MyTimer?fixedRate=true&amp;period=60s" />
>> 		<setBody>
>> 			<constant>Helloooo Zombie!</constant>
>> 		</setBody>
>> 		<to uri="activemq:test" />
>> 	</route>
>>    <route id="myroute" startupOrder="2"  routePolicyRef="startPolicy">
>> 		<from uri="activemq:test" />
>> 		<to uri="file:///tmp/tests" />
>>    </route>
>> </camelContext>
>>
>>
>
>
> It seems i'm doing something stupid here.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4654580.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: EIP pattern for blocking messages or delaying messages

Posted by srimin <sr...@gmail.com>.
Hi


using FuseESB- apache-servicemix-4.4.0-fuse-00-43


'myroute'  should be opened from 13.00 to 13:50, but i see the messages are
pumping in every minute
as if there is no routePolicy applied.


myroute.xml looks like this



> <bean id="startPolicy"
> class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
>     <property name="routeStartTime" value="0 0/10 13 * * ?"/>
> </bean>
>     
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> 	<route id="r1"  startupOrder="1">
> 		<from uri="timer://MyTimer?fixedRate=true&amp;period=60s" />
> 		<setBody>
> 			<constant>Helloooo Zombie!</constant>
> 		</setBody>
> 		<to uri="activemq:test" />
> 	</route>
>   <route id="myroute" startupOrder="2"  routePolicyRef="startPolicy">
> 		<from uri="activemq:test" />
> 		<to uri="file:///tmp/tests" />
>   </route>
> </camelContext>
> 
> 


It seems i'm doing something stupid here.




--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4654580.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EIP pattern for blocking messages or delaying messages

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

Yes, you can configure a cron scheduled route policy which starts a route
with a Camel JMS consumer at 9:00 am and brings it down at 12:00 am with a
graceful shutdown...

Should have thought of that :)...

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4612180.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EIP pattern for blocking messages or delaying messages

Posted by srimin <sr...@gmail.com>.
Hi

Just noticed from  Ashwin's blog
http://opensourceknowledge.blogspot.com/2010/09/developed-capability-in-camel-to.html

Could http://camel.apache.org/cronscheduledroutepolicy.html this be used?

I'm using spring based DSL.

rgds
srimin


--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4611897.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EIP pattern for blocking messages or delaying messages

Posted by boday <be...@initekconsulting.com>.
you can also look at Camel  http://camel.apache.org/quartz.html Quartz  for
scheduling and the  http://camel.apache.org/content-enricher.html pollEnrich 
pattern for retrieving message and passing them along to your queue...


srimin wrote:
> 
> Hi
> 
> I have a queue on which i'd like to receive JMS messages.
> I should start delivering the  messages to an endpoint during working
> hours 9.00AM to 12.00PM
> I was wondering if there is any EIP pattern that could be helpful in
> achieving it.
> 
> bw
> srim
> 


-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/EIP-pattern-for-blocking-messages-or-delaying-messages-tp4599813p4600153.html
Sent from the Camel - Users mailing list archive at Nabble.com.