If you want to call the camel route synchronously then you can use a direct
endpoint[1] and then in getMessage() use a producer template[2].
Other options are to use a seda[3] endpoint.

So something like this:

public class StandAloneCameClass implements MessageProducer {

       ProducerTemplate template;

        public static void main(String args[]) throws Exception {

                CamelContext context = new DefaultCamelContext();

                context.addRoutes(new RouteBuilder() {

                        @Override
                        public void configure() throws Exception {

                                from("direct:start").process(
MyProcessorInstance);

                        }
                });
               template = context.createProducerTemplate();

                context.start();
                Thread.sleep(10000);
                context.stop();
        }


        @Override
        public void getMessages(String s) throws Exception {
                // here am getting/received messages , which need to pass
                // to processor
               template.sendBody("direct:start", s);
        }

}


[1] http://camel.apache.org/direct.html
[2] http://camel.apache.org/producertemplate.html
[3] http://camel.apache.org/seda.html

Best regards
Pontus Ullgren


On Fri, Aug 30, 2013 at 7:27 PM, jhonny <writedeshm...@live.com> wrote:

> getMessage() is called by the java application contiously , where it insert
> the messages coniniously
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-Give-any-java-application-as-a-end-point-in-from-tp5738327p5738328.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to