H all,
I'm using akka-cluster and spring boot. As know as, I used customized 
IndirectActorProducer to inject actors.

public class SpringActorProducer implements IndirectActorProducer {


 private final ApplicationContext context;


 private final String actorBeanName;


 public SpringActorProducer(ApplicationContext context, String actorBeanName
) {
 this.context = context;
 this.actorBeanName = actorBeanName;
 }


 @SuppressWarnings("unchecked")
 @Override
 public Class<? extends Actor> actorClass() {
 return (Class<? extends Actor>) context.getType(actorBeanName);
 }


 @Override
 public Actor produce() {
 return (Actor) context.getBean(actorBeanName);
 }


}
@Component
public class SpringExtension implements Extension {


 private ApplicationContext context;


 public void initialize(ApplicationContext context) {
 this.context = context;
 }


 public Props props(String actorBeanName) {
 return Props.create(SpringActorProducer.class, context, actorBeanName);
 }
}



But in the cluster, I found the sender can use the injected actor to send 
message like this.
@Bean("ccActor")
 public ActorRef ccActor() {
 return actorSystem().actorOf(springExtesion.props("customerCareActor"), 
"cc");
}

However once the receiver actor system got the message. It created a new 
actor by the typically Props.
The new actor is non-injected.
Any ideas?

Thanks.

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to