You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tereza Nedelescu <tn...@tagged.com> on 2011/08/11 23:11:50 UTC

File contents -> socket; socket -> pipeline; fails

Hi,

The code below 
               <camel:route>
			<camel:from uri="file:/path/src/data/input/inDir?noop=true" />
			<camel:to uri="netty:tcp://999.999.99.99:8985"/>
		</camel:route>
		
		<camel:route>
 			<camel:from uri="netty:tcp://999.999.99.99:8985" />
 			<camel:pipeline>
 				<bean ref="customProcessor"/>
 			        <camel:to uri="file:/path/src/data/output/Pipeline" />   
 	  	        </camel:pipeline> 
		</camel:route>

gives the following error: SEVERE: Context initialization failed
org.apache.camel.RuntimeCamelException:
org.jboss.netty.channel.ChannelException: Failed to bind to
/999.999.99.99:8985
    at .......
(Note: 999.999.99.99 is not actually my ip address)

I'm trying to simulate having input to the bean "customProcessor" coming
from a socket. I cannot do that directly, so I send text from a file to a
socket, and then I try to read from the same socket. Is there something
wrong with this ?

Thanks,
Tereza

--
View this message in context: http://camel.465427.n5.nabble.com/File-contents-socket-socket-pipeline-fails-tp4691086p4691086.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File contents -> socket; socket -> pipeline; fails

Posted by Tereza Nedelescu <tn...@tagged.com>.
I am using my actual ip address. I wrote it here as 999.999.99.99 because I
didn't want to give my real IP address on the forum. The question was about
which one is the correct method of message routing that simulates the
processor getting data from the socket :
*1 -*  <route> file ->netty tcp socket </route>  <route> netty tcp socket ->
processor </route>
*2 - * <route> from file <pipeline> to netty tcp socket -> processor
</route>

--
View this message in context: http://camel.465427.n5.nabble.com/File-contents-socket-socket-pipeline-fails-tp4691086p4691220.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File contents -> socket; socket -> pipeline; fails

Posted by Achim Nierbeck <bc...@googlemail.com>.
Well a valid range for an IP address is between 0 and 255 where 0 and 
255 are blocked
for internal things.
you should rather use 127.0.0.1 for your local device.

Regards, Achim

Am 11.08.2011 23:11, schrieb Tereza Nedelescu:
> Hi,
>
> The code below
>                 <camel:route>
> 			<camel:from uri="file:/path/src/data/input/inDir?noop=true" />
> 			<camel:to uri="netty:tcp://999.999.99.99:8985"/>
> 		</camel:route>
> 		
> 		<camel:route>
>   			<camel:from uri="netty:tcp://999.999.99.99:8985" />
>   			<camel:pipeline>
>   				<bean ref="customProcessor"/>
>   			<camel:to uri="file:/path/src/data/output/Pipeline" />
>   	  	</camel:pipeline>
> 		</camel:route>
>
> gives the following error: SEVERE: Context initialization failed
> org.apache.camel.RuntimeCamelException:
> org.jboss.netty.channel.ChannelException: Failed to bind to
> /999.999.99.99:8985
>      at .......
> (Note: 999.999.99.99 is not actually my ip address)
>
> I'm trying to simulate having input to the bean "customProcessor" coming
> from a socket. I cannot do that directly, so I send text from a file to a
> socket, and then I try to read from the same socket. Is there something
> wrong with this ?
>
> Thanks,
> Tereza
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/File-contents-socket-socket-pipeline-fails-tp4691086p4691086.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


-- 
--
*Achim Nierbeck*


Apache Karaf<http://karaf.apache.org/>  Committer&  PMC
OPS4J Pax Web<http://wiki.ops4j.org/display/paxweb/Pax+Web/>    Committer&  Project Lead
blog<http://notizblog.nierbeck.de/>


Re: File contents -> socket; socket -> pipeline; fails

Posted by Tereza Nedelescu <tn...@tagged.com>.
At the same time, writing the following code works fine: 
                <camel:route>
 			<camel:from uri="file:/path/src/data/input/inDir?noop=true" />
 			<camel:pipeline>
 				<camel:to uri="netty:tcp://999.999.99.99:8985" />
 				<bean ref="customProc"/>
 			        <camel:to uri="file:/path/src/data/output/Pipeline" />   
 		</camel:pipeline> 
		</camel:route>

However, I'm not sure if this code simulates getting data from a socket to
the processor "customProc". Please, let me know whether this is case.

Thanks,
Tereza 

--
View this message in context: http://camel.465427.n5.nabble.com/File-contents-socket-socket-pipeline-fails-tp4691086p4691154.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File contents -> socket; socket -> pipeline; fails

Posted by Taariq Levack <ta...@gmail.com>.
Hi Tereza

Usually it says why it failed to bind.
I suppose you checked that your port is not still opened by another process you were debugging or whatever.

There's nothing wrong simulating data from a file instead, just ensure that you don't now have 2 routes trying to own that port.

PS if you want to listen you don't need your IP, you can use 0.0.0.0 as Willem said.

Taariq

On 11 Aug 2011, at 11:11 PM, Tereza Nedelescu <tn...@tagged.com> wrote:

> Hi,
> 
> The code below 
>               <camel:route>
>            <camel:from uri="file:/path/src/data/input/inDir?noop=true" />
>            <camel:to uri="netty:tcp://999.999.99.99:8985"/>
>        </camel:route>
>        
>        <camel:route>
>            <camel:from uri="netty:tcp://999.999.99.99:8985" />
>            <camel:pipeline>
>                <bean ref="customProcessor"/>
>                    <camel:to uri="file:/path/src/data/output/Pipeline" />   
>                  </camel:pipeline> 
>        </camel:route>
> 
> gives the following error: SEVERE: Context initialization failed
> org.apache.camel.RuntimeCamelException:
> org.jboss.netty.channel.ChannelException: Failed to bind to
> /999.999.99.99:8985
>    at .......
> (Note: 999.999.99.99 is not actually my ip address)
> 
> I'm trying to simulate having input to the bean "customProcessor" coming
> from a socket. I cannot do that directly, so I send text from a file to a
> socket, and then I try to read from the same socket. Is there something
> wrong with this ?
> 
> Thanks,
> Tereza
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/File-contents-socket-socket-pipeline-fails-tp4691086p4691086.html
> Sent from the Camel - Users mailing list archive at Nabble.com.