camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: mina tcp client problem
Date Fri, 22 Aug 2008 14:44:55 GMT
Hi

You need to use the sync=true option for the mina component to instruct it to be in synchronous
mode and wait for a response.

See the mina documentation and read about this option.
http://activemq.apache.org/camel/mina.html

You use-case is documented there with a sample using textline and sync=true.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: dkozic [mailto:drazen.kozic@asw.eu] 
Sent: 22. august 2008 13:51
To: camel-user@activemq.apache.org
Subject: mina tcp client problem


Hi,

I would like to make route that will send text line to remote tcp host:port,
read response and proceed with that response in body further in route. I
have already make something similar with 

I tried with following route:

from("timer://whcTimer?period=20000&delay=10000")
.setBody(constant("0001134765 C 65405818"))
.processRef("systemOutProcessor").processRef("debugProcessor")
.to("seda:whcLog")
.to("mina:tcp://172.18.3.145:6562?textline=true&minaLogger=true")
.processRef("systemOutProcessor")
.processRef("debugProcessor").to("seda:whcLog");

from("seda:whcLog").to("log:asw.someLogger?level=DEBUG&showHeaders=true");

The log output is:

2008-08-22 13:32:57,640 [timer://whcTimer?period=20000&delay=10000] DEBUG
asw.camel.processor.DebugProcessor:15  - inMessage: Message: 0001134765 C
65405818
2008-08-22 13:32:57,640 [timer://whcTimer?period=20000&delay=10000] DEBUG
asw.camel.processor.DebugProcessor:18  - inMessageBody: 0001134765 C
65405818
2008-08-22 13:32:57,640 [seda:whcLog thread:1] DEBUG asw.someLogger:73  -
Exchange[Headers:{}, BodyType:String, Body:0001134765 C 65405818]
2008-08-22 13:32:57,656 [timer://whcTimer?period=20000&delay=10000] INFO 
org.apache.camel.component.mina.MinaProducer$ResponseHandler:69  -
[/172.18.3.145:6562] WRITE: 0001134765 C 65405818
Entered SystemOutProcessor.
2008-08-22 13:32:57,671 [timer://whcTimer?period=20000&delay=10000] DEBUG
asw.camel.processor.DebugProcessor:15  - inMessage: Message: 0001134765 C
65405818
2008-08-22 13:32:57,671 [timer://whcTimer?period=20000&delay=10000] DEBUG
asw.camel.processor.DebugProcessor:18  - inMessageBody: 0001134765 C
65405818
2008-08-22 13:32:57,671 [seda:whcLog thread:1] DEBUG asw.someLogger:73  -
Exchange[Headers:{}, BodyType:String, Body:0001134765 C 65405818]
2008-08-22 13:32:57,671 [AnonymousIoService-2] INFO 
org.apache.camel.component.mina.MinaProducer$ResponseHandler:69  -
[/172.18.3.145:6562] SENT: 0001134765 C 65405818
2008-08-22 13:32:57,718 [AnonymousIoService-3] INFO 
org.apache.camel.component.mina.MinaProducer$ResponseHandler:69  -
[/172.18.3.145:6562] RECEIVED: 00  904765 ID: 65405818 ERROR: 300021 -
Subscriber record was not created: subscriber already exists

>From the log you can see that mina does tcp send and receive data. But,
after mina the in message body is same as before. 

How to access response from remote server?
As I said, I expected behavior like in http component. I have tried with
sync = "true" with no success.

Platform: Camel 1.4, jdk1.5.0_10, Eclipse 3.3, Tomcat 5.5.17, Windows XP SP1

Thanks in advance
-- 
View this message in context: http://www.nabble.com/mina-tcp-client-problem-tp19105767s22882p19105767.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message