Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. companyIds = getCompaniesByIndustry(industryId)
  2.  
  3. for( companyId : companyIds){
  4. FetchActor.tell(companyId ,self())
  5. }
  6.  
  7. @Component
  8. @Scope("prototype")
  9. SOAPAPI soapAPI{
  10. return URL; /// other componenet SOAP service
  11. }
  12.  
  13. @Component
  14. @Scope("prototype")
  15. FetchActor extends UntypedActor {
  16. @Override
  17. public void preStart() throws Exception {
  18. //
  19. }
  20. public void onReceive(Object msg) throws Throwable {
  21. if(msg instanceof String) {
  22. String companyId = (String ) msg;
  23. // fetch results of companyId by calling SOAP URL ---this is causing issue here
  24. //save results in lis/db table.
  25. }
  26. }
  27.  
  28. @Bean
  29. public ActorSystem actorSystem() {
  30.  
  31. ActorSystem system = ActorSystem.create("ActorSystem", akkaConfiguration());
  32. springExtension.initialize(applicationContext);
  33.  
  34. system.actorOf((springExtension.props("fetchActor")).withRouter(new RoundRobinPool( 5 )), "FetchActor");
  35.  
  36.  
  37. return system;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement