camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "pmp.martins" <>
Subject Send a message in the easiest way
Date Fri, 08 Nov 2013 19:46:16 GMT
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:

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

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):

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:
Sent from the Camel - Users mailing list archive at

View raw message