I want my push endpoint to be my bean, but when onMessage triggers, transactionService is not injected and stays null.
How can i get this variable to be in the same context?
Code: Select all
@Named
@Scope("session")
@PushEndpoint("/notify")
public class NotifyBean implements Serializable {
@Inject
@Qualifier("transactionService")
private TransactionService transactionService;
@OnMessage(encoders = {JSONEncoder.class})
public NotificationTemplate onMessage(NotificationTemplate notificationTemplate) {
return notificationTemplate;
}
}