You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rtmacphail <rt...@gmail.com> on 2011/07/25 15:09:48 UTC

Camel-Mina socket question

I am using the camel-mina component (ver. 2.7.0) for an that acts as a
routing mechanism for messages between a single host and a number of
clients. The clients use camel-mina as well. A client sends a single request
message and receives about a dozen response messages from the host. If the
client is connected directly to the host (with the routing application
removed) everything works fine.

However, when the routing application starts sending messages back to the
client, it works for a few messages, but eventually resets the socket after
sending one message and then resends it. Eventually a timeout error occurs
because the producer doesn't receive an OUT message within 30 seconds from
the message that was set prior to resetting the socket. (Both the producer
and the consumer are synchronous).

The consumer looks like this:

from("mina:tcp://{{ire.listen.host}}:{{ire.listen.port}}?codec=#ireCodec&sync=true&minaLogger=true&disconnectOnNoReply=false")

The producer looks like this:

.to("mina:tcp://{{B}}:{{send.to.client.port}}?codec=#ireCodec&sync=true&minaLogger=true")

A successful message exchange logs like this:

08:55:07,890  INFO route1:196 - I'm sending response to 198.167.46.100
08:55:07,906  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
WRITE: IRESND  PE-T  admin   4480           
00000659110000N240000000000000000            565DVE1PE-T  BC-T       
QPM1000000YT000         0A93874D          TARGET JURISDICTION NOT AVAILABLE
OR DOWN                                     DESTINATION NON DISPONIBLE OU
FERMEE
08:55:07,906  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
SENT: IRESND  PE-T  admin   4480           
00000659110000N240000000000000000            565DVE1PE-T  BC-T       
QPM1000000YT000         0A93874D          TARGET JURISDICTION NOT AVAILABLE
OR DOWN                                     DESTINATION NON DISPONIBLE OU
FERMEE

08:54:25,546  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
RECEIVED: CONFIRMED


An unsuccessful exchange logs like this:

08:54:46,453  INFO route1:196 - I'm sending response to 198.167.46.100
08:54:46,453  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
WRITE: IRESND  PE-T  admin   4480           
00000659110000N240000000000000000            565DVE1PE-T  NB-T       
QPM1000000YT000         0A93874D          TARGET JURISDICTION NOT AVAILABLE
OR DOWN                                     DESTINATION NON DISPONIBLE OU
FERMEE
08:54:46,453  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
SENT: IRESND  PE-T  admin   4480           
00000659110000N240000000000000000            565DVE1PE-T  NB-T       
QPM1000000YT000         0A93874D          TARGET JURISDICTION NOT AVAILABLE
OR DOWN                                     DESTINATION NON DISPONIBLE OU
FERMEE

Then I don't receive the CONFIRMED message and the socket reconnects and
sends the same message again:

08:55:07,375  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
CREATED
08:55:07,390  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
OPENED
08:55:07,390  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
WRITE: IRESND  PE-T  admin   4480           
00000659110000N240000000000000000            565DVE1PE-T  NB-T       
QPM1000000YT000         0A93874D          TARGET JURISDICTION NOT AVAILABLE
OR DOWN                                     DESTINATION NON DISPONIBLE OU
FERMEE
08:55:07,390  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
SENT: IRESND  PE-T  admin   4480           
00000659110000N240000000000000000            565DVE1PE-T  NB-T       
QPM1000000YT000         0A93874D          TARGET JURISDICTION NOT AVAILABLE
OR DOWN                                     DESTINATION NON DISPONIBLE OU
FERMEE

08:55:07,593  INFO MinaProducer$ResponseHandler:69 - [/198.167.46.100:3602]
RECEIVED: CONFIRMED

Then I receive the timeout exception on the first message that seems to get
lost in the ether.

Sorry for being so long-winded. I'm just wondering if anyone has any ideas
about what would make mina behave like this? Could there be a problem with
running out of socket threads or blocking or something like that? (According
to the documentation, camel-mina threading problems were resolved after
version 1.6).

Any suggestion would be appreciated.

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Mina-socket-question-tp4630682p4630682.html
Sent from the Camel - Users mailing list archive at Nabble.com.