Skip to content

Instantly share code, notes, and snippets.

@nobodyiam
Last active May 7, 2016 08:07
Show Gist options
  • Save nobodyiam/e9d995593087f7bd59a96a01c32d198a to your computer and use it in GitHub Desktop.
Save nobodyiam/e9d995593087f7bd59a96a01c32d198a to your computer and use it in GitHub Desktop.
@RestController
@RequestMapping("/notifications")
public class NotificationControllerSample implements MessageListener {
@Autowired
private EntityManagerUtil entityManagerUtil;
private List<String> findWatchedKeys(String applicationId, String namespace,
String dataCenter) {
List<String> watchedKeys = Lists.newArrayList();
//do more logic, may need to load from db in some cases
/**
* Manually close the entity manager.
*/
entityManagerUtil.closeEntityManager();
return watchedKeys;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment