You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by falvarez <fa...@ancap.com.uy> on 2010/08/06 22:45:23 UTC

Camel / Exec

I wonder if I have any way to send directly to the content of a message
directly to a database either.
We hope to receive data and according to data received will be certain
tasks.

-----
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
mismas cosas.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2267073.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Camel / Exec

Posted by falvarez <fa...@ancap.com.uy>.
ok, i will try to use this option.

-----
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
mismas cosas.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2740527.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Camel / Exec

Posted by Johan Edstrom <se...@gmail.com>.
Camels exec module will try to stream the Body of the Message to STDIN for the process, 
the result of the process STDOUT becomes the new body to use.

On Aug 27, 2010, at 2:23 PM, falvarez wrote:

> 
> OK, now I understand.
> 
> Why it works for the second configuration and not for the first?
> 
> The program is developed in C #.
> 
> What would be the way to pass parameter in the command line?
> 
> -----
> Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
> mismas cosas.
> -- 
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2740517.html
> Sent from the Camel Development mailing list archive at Nabble.com.

Johan Edstrom

joed@opennms.org

They that can give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety.

Benjamin Franklin, Historical Review of Pennsylvania, 1759






Re: Camel / Exec

Posted by falvarez <fa...@ancap.com.uy>.
OK, now I understand.

Why it works for the second configuration and not for the first?

The program is developed in C #.

What would be the way to pass parameter in the command line?

-----
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
mismas cosas.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2740517.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Camel / Exec

Posted by Johan Edstrom <se...@gmail.com>.
The form: implies that you already have read the message.
To read it again, you'd have to avoid acknowledgement or simply pass the message as a cmd line option to the exe program.

If the EXE program 'speaks' JMS (Does it?) then I don't see why you need the extra hop.
On Aug 27, 2010, at 1:26 PM, falvarez wrote:

> 
> johan,
> 
> I tell you:
> 
> In the ActiveMQ applicationContext.xml file I configure the following:
> 
>      <route>
>            <from uri="activemq:queue:COLA_PRUEBA_TEST"/>
>            <to
> uri="exec:C:/LogsTestTrigger/PruebaTrigger_20100826/ActiveMQ_ReciboAutomatico.exe"/>
>      </route>
> 
> 
> So that when a message arrives in the queue "COLA_PRUEBA_TEST" run the
> following program: "ActiveMQ_ReciboAutomatico.exe"
> 
> The program does the following: Read the same queue, the "COLA_PRUEBA_TEST"
> and record the content of the message in a database through a webservice
> that is posted on a server.
> 
> The problem is: When you run the program no longer exists message in the
> queue. Therefore, no records in my database.
> 
> So I can do so that the message can be read by the program?
> 
> Note:
> 
> with this configuration will work properly:
> <route>
>         <from uri="activemq:queue:COLA_PRUEBA"/>
> 	<multicast>
> 	    <to uri="activemq:queue:COLA_PRUEBA_TEST"/>
>                 <to
> uri="exec:C:/LogsTestTrigger/PruebaTrigger_20100826/ActiveMQ_ReciboAutomatico.exe"/>
>             </multicast>
> </route>
> 
> 
> 
> 
> -----
> Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
> mismas cosas.
> -- 
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2740463.html
> Sent from the Camel Development mailing list archive at Nabble.com.

Johan Edstrom

joed@opennms.org

They that can give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety.

Benjamin Franklin, Historical Review of Pennsylvania, 1759






Re: Camel / Exec

Posted by falvarez <fa...@ancap.com.uy>.
johan,

I tell you:

In the ActiveMQ applicationContext.xml file I configure the following:

      <route>
            <from uri="activemq:queue:COLA_PRUEBA_TEST"/>
            <to
uri="exec:C:/LogsTestTrigger/PruebaTrigger_20100826/ActiveMQ_ReciboAutomatico.exe"/>
      </route>


So that when a message arrives in the queue "COLA_PRUEBA_TEST" run the
following program: "ActiveMQ_ReciboAutomatico.exe"

The program does the following: Read the same queue, the "COLA_PRUEBA_TEST"
and record the content of the message in a database through a webservice
that is posted on a server.

The problem is: When you run the program no longer exists message in the
queue. Therefore, no records in my database.

So I can do so that the message can be read by the program?

Note:

with this configuration will work properly:
<route>
         <from uri="activemq:queue:COLA_PRUEBA"/>
	<multicast>
	    <to uri="activemq:queue:COLA_PRUEBA_TEST"/>
                 <to
uri="exec:C:/LogsTestTrigger/PruebaTrigger_20100826/ActiveMQ_ReciboAutomatico.exe"/>
             </multicast>
</route>




-----
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
mismas cosas.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2740463.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Camel / Exec

Posted by Johan Edstrom <se...@gmail.com>.
I am not entirely sure I followed that.
Do you have an existing route that fails? Can you trace/debug it?


On Aug 9, 2010, at 22:32, falvarez <fa...@ancap.com.uy> wrote:

> 
> Johan,
> 
> the arrival of a message to the queue with a run EXEC. exe that consumes the
> message that came to the same queue. The issue is that the message
> disappears and I can not be processed. That is what may be happening?
> 
> 
> 
> -----
> Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
> mismas cosas.
> -- 
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2320895.html
> Sent from the Camel Development mailing list archive at Nabble.com.

Re: Camel / Exec

Posted by falvarez <fa...@ancap.com.uy>.
Johan,

the arrival of a message to the queue with a run EXEC. exe that consumes the
message that came to the same queue. The issue is that the message
disappears and I can not be processed. That is what may be happening?



-----
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
mismas cosas.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2320895.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Camel / Exec

Posted by falvarez <fa...@ancap.com.uy>.
I have followed this way:

record a log of every step the executable.

and the following happens:

1-the message arrives
2-triggers the executable and connect to the ActiveMQ
3-Turns on listener of the tail.
But can not read the contents of the incoming message.

Note: development of the executable is in C #

What will happen?
You can do this I am trying

Pass you the sentence that is within the Spring applicationContext.xml to
verify them.

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
		<route>
			<from uri="activemq:TEST_QUEUE"/>
			<to
uri="exec:C:/LogsTestTrigger/est/bin/Debug/ActiveMQ_ReciboAutomatico.exe"/>

	        </route>
    </camelContext>


-----
Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
mismas cosas.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2458474.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Camel / Exec

Posted by Johan Edstrom <jo...@opennms.org>.
There are quite a few options....

bean, jdbc, jpa, hibernate comes to mind.

So there should be plenty of opportunity there.

http://camel.apache.org/components.html


On Aug 6, 2010, at 2:45 PM, falvarez wrote:

> 
> I wonder if I have any way to send directly to the content of a message
> directly to a database either.
> We hope to receive data and according to data received will be certain
> tasks.
> 
> -----
> Todos somos muy ignorantes. Lo que ocurre es que no todos ignoramos las
> mismas cosas.
> -- 
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Exec-tp2267073p2267073.html
> Sent from the Camel Development mailing list archive at Nabble.com.

Johan Edstrom

joed@opennms.org

They that can give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety.

Benjamin Franklin, Historical Review of Pennsylvania, 1759