camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamie3 <>
Subject Closing mina:tcp socket?
Date Wed, 22 Oct 2008 12:12:59 GMT

I have situation where I have a system connecting to my Mina:tcp endpoint and
the system connected requires me to close the socket connection when I
receive a specific set of characters signaling an end of message. 

If I don't close the socket then the system connecting to me waits for an
un-specified amount of time (sometimes 5 minutes) before the socket is
closed at the system side. Once the socket is closed the system sends the
next message.

I don't want to close the server-side socket, but the connection to the
client. Thus, allowing multiple people to connect to the server
concurrently. Similar to an HTTP server.

My EIP is as follows:

		// aggregator for grouping the input from the tcp socket into a gold
		AggregationCollection ag = new PredicateAggregationCollection(
				new MessageAggregator(),   // reads each line coming from the tcp socket
and aggregates it into a string object
				new MessagePredicate()      // the comparator for determining when the
end of the message is found
			// tag the message id so the aggregator can pick it up
					// send tracks to message processor / correlator
                                        // TODO need a way to send a
response back to mina and close the socket to the connected system
					// unsupported message
						throwFault("Unsupported message id: " + header("id"));
Essentially I need a way to provide feedback to the from("mina:tcp....")
endpoint and tell it to close the socket for the specific system.

Is this even possible, and if so how can it be done?

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message