Re: [akka-user] Re: Send message from netty code to actor system
Hello Muthukumaran, I'm not actually using nettty but cloudhopper-smpp. It uses netty. I couldn't work out how to integrate cloudhopper-smpp with Akka and hence I was looking at netty to understand ways of integrating cloudhopper-smpp to netty. I'm wrapping each SmppSession inside it's own actor. On Friday, 6 February 2015 10:54:37 UTC, Muthukumaran Kothandaraman wrote: Few things to take care of using a router at InboundHandler - ensuring that routees are available before the connections are being accepted - ensuring that ChannelContextHandler - passed in message, is not stored by routee actor internally for any purposes. This should be sufficient for pure req/reply pattern Regards Muthu On Thursday, 5 February 2015 03:39:18 UTC+5:30, Jabbar Azam wrote: After alot of head scratching I came to same conclusions as you. It's good to see somebody else having the same ideas. On Wednesday, 4 February 2015 21:06:11 UTC, Ngoc Dao wrote: Generally there are 2 ways to design for this problem: Once you have an actor reference, you can send things to it. So you can simply do this: targetActorRef ! myThing When the actor is done with the processing, it will call: myThing.myMethod This design is OK when the target actor is very reliable and it lies in the same node with myThing. Another way, is to use an actor to wrap around myThing. This wrapper actor will communicate with targetActorRef. It may watch targetActorRef to handle the case when targetActorRef dies, targetActorRef doesn't respond after some timeout etc. On Wednesday, February 4, 2015 at 10:09:19 PM UTC+9, Jabbar Azam wrote: I found some nice example showing integration of netty with akka on github. This is what I'm looking at https://github.com/gibffe/fuse specifically https://github.com/gibffe/fuse/blob/master/src/main/java/com/sulaco/fuse/netty/FuseChannelHandler.java Its embarrassingly simple :) On Tuesday, 3 February 2015 13:48:47 UTC, Jabbar Azam wrote: Oops I meant channel handler. On Tuesday, 3 February 2015 13:32:21 UTC, Jabbar Azam wrote: Hello, Sorry for the late reply. For some reason the forum messages didn't get forwarded to my email. I was thinking of using typedactors because I am trying to integrate non actor code(cloudhopper SMPP which uses netty) into an actor system. Netty does use callbacks so I can use asynchronous behaviour. Do you think I could encapsulate a netty channel inside an actor? A netty channel can call callbacks whenever something changes in the channel. On Friday, 30 January 2015 12:38:14 UTC, Björn Antonsson wrote: Hi, Are you sure that you need to block the sending code while the actor does its work? Is there an asynchronous API in netty that you can use where the actor would invoke a callback when it has finished processing the packet? B/ On 27 January 2015 at 11:03:26, Jabbar Azam (aja...@gmail.com) wrote: I think I need to look at typedactors. On Tuesday, 27 January 2015 09:29:43 UTC, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com. To post to this group, send email to akka...@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Björn Antonsson Typesafe http://typesafe.com/ – Reactive Apps on the JVM twitter: @bantonsson http://twitter.com/#!/bantonsson -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: Send message from netty code to actor system
Few things to take care of using a router at InboundHandler - ensuring that routees are available before the connections are being accepted - ensuring that ChannelContextHandler - passed in message, is not stored by routee actor internally for any purposes. This should be sufficient for pure req/reply pattern Regards Muthu On Thursday, 5 February 2015 03:39:18 UTC+5:30, Jabbar Azam wrote: After alot of head scratching I came to same conclusions as you. It's good to see somebody else having the same ideas. On Wednesday, 4 February 2015 21:06:11 UTC, Ngoc Dao wrote: Generally there are 2 ways to design for this problem: Once you have an actor reference, you can send things to it. So you can simply do this: targetActorRef ! myThing When the actor is done with the processing, it will call: myThing.myMethod This design is OK when the target actor is very reliable and it lies in the same node with myThing. Another way, is to use an actor to wrap around myThing. This wrapper actor will communicate with targetActorRef. It may watch targetActorRef to handle the case when targetActorRef dies, targetActorRef doesn't respond after some timeout etc. On Wednesday, February 4, 2015 at 10:09:19 PM UTC+9, Jabbar Azam wrote: I found some nice example showing integration of netty with akka on github. This is what I'm looking at https://github.com/gibffe/fuse specifically https://github.com/gibffe/fuse/blob/master/src/main/java/com/sulaco/fuse/netty/FuseChannelHandler.java Its embarrassingly simple :) On Tuesday, 3 February 2015 13:48:47 UTC, Jabbar Azam wrote: Oops I meant channel handler. On Tuesday, 3 February 2015 13:32:21 UTC, Jabbar Azam wrote: Hello, Sorry for the late reply. For some reason the forum messages didn't get forwarded to my email. I was thinking of using typedactors because I am trying to integrate non actor code(cloudhopper SMPP which uses netty) into an actor system. Netty does use callbacks so I can use asynchronous behaviour. Do you think I could encapsulate a netty channel inside an actor? A netty channel can call callbacks whenever something changes in the channel. On Friday, 30 January 2015 12:38:14 UTC, Björn Antonsson wrote: Hi, Are you sure that you need to block the sending code while the actor does its work? Is there an asynchronous API in netty that you can use where the actor would invoke a callback when it has finished processing the packet? B/ On 27 January 2015 at 11:03:26, Jabbar Azam (aja...@gmail.com) wrote: I think I need to look at typedactors. On Tuesday, 27 January 2015 09:29:43 UTC, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com. To post to this group, send email to akka...@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Björn Antonsson Typesafe http://typesafe.com/ – Reactive Apps on the JVM twitter: @bantonsson http://twitter.com/#!/bantonsson -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: Send message from netty code to actor system
Generally there are 2 ways to design for this problem: Once you have an actor reference, you can send things to it. So you can simply do this: targetActorRef ! myThing When the actor is done with the processing, it will call: myThing.myMethod This design is OK when the target actor is very reliable and it lies in the same node with myThing. Another way, is to use an actor to wrap around myThing. This wrapper actor will communicate with targetActorRef. It may watch targetActorRef to handle the case when targetActorRef dies, targetActorRef doesn't respond after some timeout etc. On Wednesday, February 4, 2015 at 10:09:19 PM UTC+9, Jabbar Azam wrote: I found some nice example showing integration of netty with akka on github. This is what I'm looking at https://github.com/gibffe/fuse specifically https://github.com/gibffe/fuse/blob/master/src/main/java/com/sulaco/fuse/netty/FuseChannelHandler.java Its embarrassingly simple :) On Tuesday, 3 February 2015 13:48:47 UTC, Jabbar Azam wrote: Oops I meant channel handler. On Tuesday, 3 February 2015 13:32:21 UTC, Jabbar Azam wrote: Hello, Sorry for the late reply. For some reason the forum messages didn't get forwarded to my email. I was thinking of using typedactors because I am trying to integrate non actor code(cloudhopper SMPP which uses netty) into an actor system. Netty does use callbacks so I can use asynchronous behaviour. Do you think I could encapsulate a netty channel inside an actor? A netty channel can call callbacks whenever something changes in the channel. On Friday, 30 January 2015 12:38:14 UTC, Björn Antonsson wrote: Hi, Are you sure that you need to block the sending code while the actor does its work? Is there an asynchronous API in netty that you can use where the actor would invoke a callback when it has finished processing the packet? B/ On 27 January 2015 at 11:03:26, Jabbar Azam (aja...@gmail.com) wrote: I think I need to look at typedactors. On Tuesday, 27 January 2015 09:29:43 UTC, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com. To post to this group, send email to akka...@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Björn Antonsson Typesafe http://typesafe.com/ – Reactive Apps on the JVM twitter: @bantonsson http://twitter.com/#!/bantonsson -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: Send message from netty code to actor system
After alot of head scratching I came to same conclusions as you. It's good to see somebody else having the same ideas. On Wednesday, 4 February 2015 21:06:11 UTC, Ngoc Dao wrote: Generally there are 2 ways to design for this problem: Once you have an actor reference, you can send things to it. So you can simply do this: targetActorRef ! myThing When the actor is done with the processing, it will call: myThing.myMethod This design is OK when the target actor is very reliable and it lies in the same node with myThing. Another way, is to use an actor to wrap around myThing. This wrapper actor will communicate with targetActorRef. It may watch targetActorRef to handle the case when targetActorRef dies, targetActorRef doesn't respond after some timeout etc. On Wednesday, February 4, 2015 at 10:09:19 PM UTC+9, Jabbar Azam wrote: I found some nice example showing integration of netty with akka on github. This is what I'm looking at https://github.com/gibffe/fuse specifically https://github.com/gibffe/fuse/blob/master/src/main/java/com/sulaco/fuse/netty/FuseChannelHandler.java Its embarrassingly simple :) On Tuesday, 3 February 2015 13:48:47 UTC, Jabbar Azam wrote: Oops I meant channel handler. On Tuesday, 3 February 2015 13:32:21 UTC, Jabbar Azam wrote: Hello, Sorry for the late reply. For some reason the forum messages didn't get forwarded to my email. I was thinking of using typedactors because I am trying to integrate non actor code(cloudhopper SMPP which uses netty) into an actor system. Netty does use callbacks so I can use asynchronous behaviour. Do you think I could encapsulate a netty channel inside an actor? A netty channel can call callbacks whenever something changes in the channel. On Friday, 30 January 2015 12:38:14 UTC, Björn Antonsson wrote: Hi, Are you sure that you need to block the sending code while the actor does its work? Is there an asynchronous API in netty that you can use where the actor would invoke a callback when it has finished processing the packet? B/ On 27 January 2015 at 11:03:26, Jabbar Azam (aja...@gmail.com) wrote: I think I need to look at typedactors. On Tuesday, 27 January 2015 09:29:43 UTC, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com. To post to this group, send email to akka...@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Björn Antonsson Typesafe http://typesafe.com/ – Reactive Apps on the JVM twitter: @bantonsson http://twitter.com/#!/bantonsson -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: Send message from netty code to actor system
I found some nice example showing integration of netty with akka on github. This is what I'm looking at https://github.com/gibffe/fuse specifically https://github.com/gibffe/fuse/blob/master/src/main/java/com/sulaco/fuse/netty/FuseChannelHandler.java Its embarrassingly simple :) On Tuesday, 3 February 2015 13:48:47 UTC, Jabbar Azam wrote: Oops I meant channel handler. On Tuesday, 3 February 2015 13:32:21 UTC, Jabbar Azam wrote: Hello, Sorry for the late reply. For some reason the forum messages didn't get forwarded to my email. I was thinking of using typedactors because I am trying to integrate non actor code(cloudhopper SMPP which uses netty) into an actor system. Netty does use callbacks so I can use asynchronous behaviour. Do you think I could encapsulate a netty channel inside an actor? A netty channel can call callbacks whenever something changes in the channel. On Friday, 30 January 2015 12:38:14 UTC, Björn Antonsson wrote: Hi, Are you sure that you need to block the sending code while the actor does its work? Is there an asynchronous API in netty that you can use where the actor would invoke a callback when it has finished processing the packet? B/ On 27 January 2015 at 11:03:26, Jabbar Azam (aja...@gmail.com) wrote: I think I need to look at typedactors. On Tuesday, 27 January 2015 09:29:43 UTC, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com. To post to this group, send email to akka...@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Björn Antonsson Typesafe http://typesafe.com/ – Reactive Apps on the JVM twitter: @bantonsson http://twitter.com/#!/bantonsson -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
[akka-user] Re: Send message from netty code to actor system
Hello, I can't use Xitrum. I'm using Cloudhopper-smpp which uses netty. I don't fancy writing a SMPP library. On Monday, 2 February 2015 09:45:33 UTC, Ngoc Dao wrote: You can try Xitrum web framework (scroll down to see the Akka actor example): http://xitrum-framework.github.io/ http://www.google.com/url?q=http%3A%2F%2Fxitrum-framework.github.io%2Fsa=Dsntz=1usg=AFQjCNG3uTDlktQ0TkVHjyH6N2ZKVJZezg On Tuesday, January 27, 2015 at 6:29:43 PM UTC+9, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
[akka-user] Re: Send message from netty code to actor system
You can try Xitrum web framework (scroll down to see the Akka actor example): http://xitrum-framework.github.io/ On Tuesday, January 27, 2015 at 6:29:43 PM UTC+9, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Re: Send message from netty code to actor system
Hi, Are you sure that you need to block the sending code while the actor does its work? Is there an asynchronous API in netty that you can use where the actor would invoke a callback when it has finished processing the packet? B/ On 27 January 2015 at 11:03:26, Jabbar Azam (aja...@gmail.com) wrote: I think I need to look at typedactors. On Tuesday, 27 January 2015 09:29:43 UTC, Jabbar Azam wrote: Hello, How do I send a message from java non actor based code into an actor system? The code will be running on the same node and will be part of the same source code. So netty will be running, receiving packets, which will send any received packets into an actor system. The actor system will process the packets and then send the response payload back to the netty code. -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- Björn Antonsson Typesafe – Reactive Apps on the JVM twitter: @bantonsson -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups Akka User List group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.