Exchange timeout Mina2 issues

2015-03-03 Thread sykomaniac
Hi,

I'm using Camel to pull a message from a queue and send it to a remote
server using MINA2. I've configured the endpoint like so:

String endpoint = baseEndpoint.copy()
.setQueue(entry.Route + "." + entry.Party + ".#")
.setRoutingKey(entry.Route + "." + entry.Party + ".#")
.setExclusive(true)
.build();

//Build outgoing TCP settings
minaComp.setCamelContext(getContext());
Mina2Configuration minaCfg = new Mina2Configuration();
minaCfg.setProtocol("tcp");
minaCfg.setCodec(new HL7MLLPCodec());
minaCfg.setHost(entry.IP);
minaCfg.setPort(entry.Port);
minaCfg.setSync(true);
minaCfg.setLazySessionCreation(true);

from(endpoint)
.autoStartup(entry.ConnectionStatus ==
InterfaceStatus.Up)
.routeId(String.format("%s.%s", entry.Party,
entry.Description))
.to(minaComp.createEndpoint(minaCfg))
.process(new Processor() {
@Override
public void process(Exchange exchange) throws
Exception {
StatusUpdate.Instance.send(
entry.IP,
String.valueOf(entry.Port),
InterfaceStatus.Up);
}
});

To summarise the above code, the message is picked up off of a RabbitMQ
queue, sent to a MINA2 endpoint and then post a status update to a web
service queue.

The issue is that the code above will send one HL7 message on a clean
connection. If I then leave the connection for an indeterminate amount of
time e.g. 30 minutes, then attempt to send a further message I get the
following error:

org.apache.camel.ExchangeTimedOutException: The OUT message was not received
within: 3 millis.

If I run Wireshark I can see that the message attempted to be sent but no
ACK came back. However, when I run a netstat -a on the client I can see one
connection open and established. When I run a netstat -a on the server I can
see 2 connections. One is established, the second is a FIN_WAIT_2 state.

Does anyone know how to fix this? The server has other application
connecting and doesn't have this issue. All documentation on FIN_WAIT_2
indicates a buggy client but I can't see what's wrong. Any help would be
greatly appreciated.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Exchange-timeout-Mina2-issues-tp5763509.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-catalog 2.15.0 and karaf 2.4.1

2015-03-12 Thread sykomaniac
Hi,

Is there any way to manually resolve this without waiting for you to push
the release? I'm eager to test the new netty-4 component for HL7



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-catalog-2-15-0-and-karaf-2-4-1-tp5764038p5764046.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-catalog 2.15.0 and karaf 2.4.1

2015-03-12 Thread sykomaniac
Hi,

Thanks for the response - Only thing is that when I try installing anything
I get this message e.g. 

feature:install camel-ftp/2.15.0

Results in the same error.



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-catalog-2-15-0-and-karaf-2-4-1-tp5764038p5764049.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Exception handling for netty4 producers

2015-10-29 Thread sykomaniac
Hi,

I am using camel-netty4 as a producer. I take a message off of a Rabbit
queue and attempt to send it via netty to the server. This works perfectly
when the server is up an accepting requests. However, if the server is not
responding when I enable the client I get the following error at start-up:

Error occurred during starting Camel: CamelContext(ClientContext) due Failed
to create Producer for endpoint: Endpoint[netty4:tcp://10.0.2.2:4].
Reason: java.net.ConnectException: Cannot connect to 10.0.2.2:4.

What I want to do is capture the error and attempt a connection retry until
the server comes back on-line. 

I have tried various ways of catching this exception using the built-in
camel error handling but this is not working.

Do I need to add a customer netty handler to capture the error? Do I need a
custom netty channel factory? Basically, I'm looking for help on how to
capture the above error and retry the connection. Any help would be greatly
appreciated!




--
View this message in context: 
http://camel.465427.n5.nabble.com/Exception-handling-for-netty4-producers-tp5773180.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Exception handling for netty4 producers

2015-10-29 Thread sykomaniac
Hi Claus,

Thanks for the reply. I have configured this option as the protocol we are
using is a little strange. Essentially when the server comes on line it
expects to have a connection within 1 minute. If it does not get one it
errors, we have a maximum of 3 attempts (3 minutes) before it turns itself
off (I know this is terrible but this is what I'm working with!)

This is why I need the producer to continually retry the connection. If I
wait until we have something to send the chances are that the server will
have turned itself off.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Exception-handling-for-netty4-producers-tp5773180p5773182.html
Sent from the Camel - Users mailing list archive at Nabble.com.