|
@@ -30,8 +30,12 @@ public class WorkerController {
|
|
return sb.toString();
|
|
return sb.toString();
|
|
}
|
|
}
|
|
|
|
|
|
- @RabbitListener(queues = {"q.new_user"})
|
|
|
|
|
|
+ @RabbitListener(queues = {"${rabbitmq.queue.name}"})
|
|
public void compute(User user) {
|
|
public void compute(User user) {
|
|
|
|
+
|
|
|
|
+ HttpEntity<MailDTO> request = new HttpEntity<>(new MailDTO("system@mailer.com", "system@mailer.com", "New account created", "Created new account for user "+user.getEmail()));
|
|
|
|
+ restTemplate.postForObject("http://localhost:8080/api/v1/mailbox", request, String.class);
|
|
|
|
+
|
|
try {
|
|
try {
|
|
Thread.sleep(10 * 1000);
|
|
Thread.sleep(10 * 1000);
|
|
}
|
|
}
|
|
@@ -40,8 +44,9 @@ public class WorkerController {
|
|
}
|
|
}
|
|
|
|
|
|
String passwd = generatePasswd(6);
|
|
String passwd = generatePasswd(6);
|
|
- HttpEntity<MailDTO> request = new HttpEntity<>(new MailDTO("system@mailer.com", user.getEmail(), "New account created", "Welcome to mailer app. You can access to your account by using this password: "+passwd));
|
|
|
|
- String response = restTemplate.postForObject("http://localhost:8080/api/v1/mailbox", request, String.class);
|
|
|
|
|
|
+ request = new HttpEntity<>(new MailDTO("system@mailer.com", user.getEmail(), "Welcome to Mailer APP", "Welcome to mailer app. You can access to your account by using this password: "+passwd));
|
|
|
|
+ restTemplate.postForObject("http://localhost:8080/api/v1/mailbox", request, String.class);
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|