Skip to content

Instantly share code, notes, and snippets.

@ndemengel
Last active April 24, 2017 12:15
Show Gist options
  • Save ndemengel/df2a6e280f4710a9277bc9d82c474f55 to your computer and use it in GitHub Desktop.
Save ndemengel/df2a6e280f4710a9277bc9d82c474f55 to your computer and use it in GitHub Desktop.
@Value
public class EmailUpdated implements Event {
public static final String EXCHANGE_NAME = "email.updated.exchange";
String accountId;
String oldEmail;
String newEmail;
}
eventsService.fire(new EmailUpdated(accountId, oldEmail, newEmail));
@RabbitEventListener(queue = "some.queue")
public void emailUpdated(EmailUpdated event) {
doSomethingWith(event.getOldEmail(), event.getNewEmail());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment