Re: Socket-based Asynchronous Calls...

2011-08-29 Thread James Carman
I am a commons committer so don't think it hasn't crossed my mind. :) On Aug 28, 2011 11:48 PM, "Claus Ibsen" wrote: > On Sat, Aug 27, 2011 at 10:19 AM, James Carman > wrote: >> Well, I can tell you that it certainly didn't seem to work the way I >> need it to work. I need a persistent connectio

Re: Socket-based Asynchronous Calls...

2011-08-28 Thread Claus Ibsen
On Sat, Aug 27, 2011 at 10:19 AM, James Carman wrote: > Well, I can tell you that it certainly didn't seem to work the way I > need it to work.  I need a persistent connection (with automatic > reconnects).  I also need it to be in/out, but asynchronous (the > current incoming message may or may n

Re: Socket-based Asynchronous Calls...

2011-08-27 Thread James Carman
Well, I can tell you that it certainly didn't seem to work the way I need it to work. I need a persistent connection (with automatic reconnects). I also need it to be in/out, but asynchronous (the current incoming message may or may not correspond to the most recently sent message). For now, I'v

Re: Socket-based Asynchronous Calls...

2011-08-24 Thread Taariq Levack
I expect that the connection will only be closed if the header NettyConstants.NETTY_CLOSE_CHANNEL_WHEN_COMPLETE is true. Glancing at the code I see what you mean, it's quite unlike MINA's producer which checks the session to see if it's connected and reuses it, but it may be that under the hood, y

Re: Socket-based Asynchronous Calls...

2011-08-24 Thread James Carman
I have read the source: http://svn.apache.org/repos/asf/camel/trunk/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java Take a look at the process() method. In there, there is a block of code that does: ChannelFuture channelFuture; final Chan

Re: Socket-based Asynchronous Calls...

2011-08-23 Thread Taariq Levack
That doesn't sound right, what have you read? Logs/docs? And are you using keep-alive? Taariq On 24 Aug 2011, at 12:12 AM, James Carman wrote: > Well, it looks like the camel-netty component won't work for me. It > appears that it opens the connection for each exchange. Am I reading > that r

Re: Socket-based Asynchronous Calls...

2011-08-23 Thread James Carman
Well, it looks like the camel-netty component won't work for me. It appears that it opens the connection for each exchange. Am I reading that right? What I need is a persistent connection with automatic reconnects. Oh well, back to the drawing board. On Wed, Aug 17, 2011 at 7:59 AM, James Carm

Re: Socket-based Asynchronous Calls...

2011-08-17 Thread James Carman
That's what I've been staring at! :) Here's what I'm thinking I'm going to need to write. I need an async processor that remembers the AsyncCallback and associates it with a correlation id. Then, when another exchange comes in that has the same correlation id, it will lookup the previous callbac

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread Taariq Levack
James I think the rest of your puzzle is solved by Camel's async API, you might have to check if your task is done, maybe your requestResponse populates some collection of responses and provides some API to return the response given a correlationID. Stare at the async docs [1] a few more times and

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread James Carman
No worries! Thank you for your help. It helped me understand a bit more about how these aggregators work.. However, I still don't understand how to take care of my problem. I guess I'm going to have to roll my own processor or something. On Tue, Aug 16, 2011 at 4:50 PM, Taariq Levack wrote: >

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread Taariq Levack
Hmmm. Maybe others can help with that if it's possible, I haven't had to wrestle with it. In my case it is actually a cxf service too, but it's asynchronous and I send the response once I have it, indicating either timeout or the actual response. Sorry I responded to your question without goin

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread James Carman
In my case, the originating request comes from CXF. How do I send the aggregated response back to CXF? On Tue, Aug 16, 2011 at 4:29 PM, Taariq Levack wrote: > The consumer that handles the aggregated/timed-out request or response. > > I have to resend a few times if it's the request, I simply fe

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread Taariq Levack
The consumer that handles the aggregated/timed-out request or response. I have to resend a few times if it's the request, I simply feed it back into "direct:socketRequestRoute" with the header for the number of retry attempts incremented. If it's the response I can forward to some process. Taar

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread James Carman
What's listening on the: to("direct:requestResponse") On Tue, Aug 16, 2011 at 3:56 PM, Taariq Levack wrote: > Sure > > You can of course solve what I've described many ways, but I'll > explain using 3 routes as that's what I used. > > This first route is the main route I mentioned earlier, so yo

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread Taariq Levack
Indeed it is. On 16 Aug 2011, at 10:12 PM, James Carman wrote: > Is your socket endpoint set up to be async? > > On Tue, Aug 16, 2011 at 3:56 PM, Taariq Levack wrote: >> Sure >> >> You can of course solve what I've described many ways, but I'll >> explain using 3 routes as that's what I used.

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread James Carman
Is your socket endpoint set up to be async? On Tue, Aug 16, 2011 at 3:56 PM, Taariq Levack wrote: > Sure > > You can of course solve what I've described many ways, but I'll > explain using 3 routes as that's what I used. > > This first route is the main route I mentioned earlier, so you send > yo

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread Taariq Levack
Sure You can of course solve what I've described many ways, but I'll explain using 3 routes as that's what I used. This first route is the main route I mentioned earlier, so you send your socket messages here and it's multicast to both the aggregator and to the socket. from("direct:socketRequest

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread James Carman
Care to share an example? I'm not picturing it. On Tue, Aug 16, 2011 at 3:23 PM, Taariq Levack wrote: > Hi James > > I did that too for what it's worth. > I send the message to a route that forwards to both the aggregator and to the > socket. > When the response comes in I use an enricher to ad

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread Taariq Levack
Hi James I did that too for what it's worth. I send the message to a route that forwards to both the aggregator and to the socket. When the response comes in I use an enricher to add the ID to the headers and then forward to the aggregator. Taariq On 16 Aug 2011, at 8:55 PM, James Carman wro

Re: Socket-based Asynchronous Calls...

2011-08-16 Thread James Carman
Willem, Thank you for your help. I don't think this is doing exactly what I need, though. The real trick here is the asynchronous nature of the "server" on the other end of this situation. I thought about using an aggregator to make sure the response gets matched up with the request using a cor

Re: Socket-based Asynchronous Calls...

2011-08-07 Thread Willem Jiang
Hi James, Camel async process engine already provides the way that you want. You can take a look at the camel-cxf code[1][2] for some example. [1]http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java?view=markup [2]http://svn.

Re: Socket-based Asynchronous Calls...

2011-08-06 Thread James Carman
On Sat, Aug 6, 2011 at 10:33 AM, Zbarcea Hadrian wrote: > Hi James, > > I hope I understand your scenario correctly. Here are a few thoughts. I > assume want to use camel-netty [1] to send messages to your sever (if you > have your own code that does that, you can use it too, but you'd have to

Re: Socket-based Asynchronous Calls...

2011-08-06 Thread Zbarcea Hadrian
Hi James, I hope I understand your scenario correctly. Here are a few thoughts. I assume want to use camel-netty [1] to send messages to your sever (if you have your own code that does that, you can use it too, but you'd have to write your own Processor or Component). Iiuic, your scenario is co

Socket-based Asynchronous Calls...

2011-08-06 Thread James Carman
We have a server that supports a socket-based protocol. However, it's not a synchronous situation. I send a message over the output stream of the socket and a it goes over to the server to processed. The reply message will be received at some later time on the socket's input stream, not necessar