camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaddyOh <epal...@richmond.edu>
Subject Can I use a bean in place of a producer
Date Fri, 11 Dec 2015 19:04:01 GMT
This route seems to work fine in test. I've left out the bean specifications
for this context file for simplicity.  

    <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>

        <from uri="timer://spcs2radius?fixedRate=true&amp;period=10000"/>
        <bean ref="spcs2RadiusPosts" method="process"/>
        <to
uri="smtp://somesmtp.host?port=someport&amp;from=someuser@richmond.edu&amp;to=someotheruser@richmond.edu&amp;subject=spcs2radius
successful route&amp;contentType=text/plain"/>
    </route>
    </camelContext>

The bean does all of the work. It reads from  a database and if records
present it formats them into json and sends them to another internal system.
I will want this to deadletter if there is an exception in the processing. 
This is low volume route. Up to 10 times a day it will find data and write
it to the other system.
 

The producer sends an email confirmation that the route was completed. 
Other than the complexity of the bean doing all the work are there risks for
not having a custom producer to store the data in the other system and use a
splitter to also send the email? Put another way should I write a producer
or let the bean do the work?

Thanks
Eric 




--
View this message in context: http://camel.465427.n5.nabble.com/Can-I-use-a-bean-in-place-of-a-producer-tp5775013.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message