To send a message then using the ProducerTemplate is the easiest.

You can use that to send a message to any Camel endpoint.

You can find some details about this on the Camel web site, and also
appendix C in the CiA book

There is also annotations such as @Produce
http://camel.apache.org/pojo-producing.html
http://camel.apache.org/pojo-messaging-example.html



On Fri, Nov 8, 2013 at 8:46 PM, pmp.martins
<pmp.mart...@campus.fct.unl.pt> wrote:
> I am trying to create a sample application hosted at
> "mina:tcp://localhost:9991" that sends a very simple message to a server
> hosted at "mina:tcp://localhost:9990".
>
> Now admittedly I have some problems understanding how to do this. My first
> approach was to create a class called Message, that had two fields: String
> order and String host. However, I am terribly confused on how to do this.
>
> First I tried to follow the loadbalancer-example basing myself on the
> ReportGenerator and create a MessageGenerator class that could create a
> message and return it:
> http://camel.apache.org/loadbalancing-mina-example.html
>
> However, there is a problem, I need parameters to create my Message,
> something that doesn't happen when creating the Report from the example.
>
> By reading Camel in Action In know how to use beans to call methods that
> have no parameters, however I still do not understand how I should use them
> to call a method that has several parameters (Am I forced to use
> processors?)
>
> Then i realized that perhaps I am complicating things a little bit and there
> is an easier way to send messages. So I tried another approach that resulted
> in this small code (26 lines):
> http://pastebin.kde.org/pvedrm6er
>
> But it still does not work. Obviously I am doing something wrong and I don't
> get what. So, I have 3 questions:
> 1 - What is the easiest way to send a very simple message to another server
> using Camel?
> 2 - What is the easiest way to create and send an object that requires
> several parameters through Camel?
> 3 - Is my code wrong? If yes, what is wrong with it?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Send-a-message-in-the-easiest-way-tp5742890.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to