camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "pmp.martins" <pmp.mart...@campus.fct.unl.pt>
Subject Re: Send a message in the easiest way
Date Sat, 09 Nov 2013 12:45:26 GMT
@Ceposta: Ok, Thank you for your time and interest Mr. Ceposta. I have now
numbered the questions and will try my best to explain the situation:

Q1: What parameters do you need? If I understand you correctly, you want to
create a bean that "creates" your Message object, right? And you need
parameters to be passed in to your bean that are used to set the order/host
fields of the Message object? 

A1: That is exactly what I need. Just like in the report example, but with
parameters. Here is a very simple code to demonstrate:

public class MessageGenerator  {
    //method that I want to call !
    public Message createMessage(String anOrder, String aHost) throws
Exception {
        return new Message(anOrder, aHost);
    }
}

Q2: Where would those values be? 

A2: By using the Beans method of sending a Message, the valued would be
bean(MessageGenerator.class, "createMessage('add',
'mina:tcp://localhost:9991')"). I saw that link yesterday and I read it
entirely. I even got a sample done but for a reason I cannot possibly
understand, it only works when I use a timer, not to mention all the
Warnings and errors I get because MyApp_A is not responding back even though
MyApp_B expects a reply (and I have idea on how to fix this).

Here are the links to the very small samples if you are interested (it gives
good karma ! [maybe :P ] ):
MyApp_B: http://pastebin.kde.org/piueq9cix
MessageGenerator: http://pastebin.kde.org/pqi28hds0
MyApp_A: http://pastebin.kde.org/pgr99wbxc
MyRecipientListBean: http://pastebin.kde.org/pg8usb6vq

I have also read the majority of chapter 4 in the book Camel in Action. I
would not have posted here if I had not done so (I also get annoyed when I
see people don't do their homework correctly :P )

Q3: So what doesn't work? Where/how are you invoking the route (calling the
direct:start endpoint)? 

A3: So far, When MyApp_B does not seem to be creating any messages! And I
don't know why! According to this link:
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html

All routes are automatically started (quoting the page "By default a route
is auto started.").
However, that is not happening. Consequently, MyApp_A is waiting for nothing
! Admittedly I am confused.

@Mr. Claus: I had no idea about those resources, I will try researching them
to see what else I can learn !



--
View this message in context: http://camel.465427.n5.nabble.com/Send-a-message-in-the-easiest-way-tp5742890p5742923.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message