I am using Play Controller action to make a REST call. But on success of 
that call, i want to Trigger a service implemented as a Akka Actor.

Below is my code for making the REST call with a controller action. I need 
help how to insert the code to trigger the service on the Akka Actor
<xmp>

public static Promise<Result> create() throws Exception{

    Promise<Result> resultPromise=null;
    try {
        User user = getRegisteredUser();
        DataRequestObject dataRequestObject= new DataRequestObject(new 
HashMap(), RequestMethod.POST,getClientIpAddr());
        Promise<WSResponse> responsePromise = user.save(UserStep.REGISTRATION, 
DataRepositoryStrategy.CLOUDANT,WS.client(),dataRequestObject);
        resultPromise = responsePromise.map(
                new Function<WSResponse, Result>() {
                    @Override
                    public Result apply(WSResponse response) throws Exception {
                        ResponseObject responseObject = 
DBECodesFactory.getResponseObject(response.asJson(), new String[]{"email", 
user.name.username});
                        if (responseObject.isSuccess()) {
                           // Trigger Akka Actor Service
                            return ok(views.html.postreg.render());
                        } else {
                            flash("error", responseObject.getFailureReason());
                           return  redirect(routes.Users.register());// 
ok(views.html.register.render());

                        }
                    }
                });

    }catch (Exception d){
        Logger.getLogger("NEW REGISTRATION").log(Level.SEVERE, d.toString(), d);
        d.printStackTrace();
        throw new Exception(d);
    }
    return resultPromise;



}

</xmp>

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to