Nigel, what do you mean by :
"The application must obtain an instance of the JMS listener bean using dependency injection"
In your examples, it looks like a CDI bean cannot start listening if not injected :
@WebServlet("/myjmsservlet1")
public class MyJMSServlet1 extends HttpServlet {
@Inject MyDepScopeListenerBean myDepScopeListenerBean;
public void service(ServletRequest req, ServletResponse res) throws IOException, ServletException {
...
}
}
Did I understand well ? Is this the case ? Just like a MDB, I would like a CDI bean to start listening to a message without being injected, as soon as the application starts. Something like :
@ApplicationScoped
public class MyListenerBean{
@JMSListener(lookup="java:global/java:global/Trades",type=JMSListener.Type.TOPIC )
public void deliver(Message message) {
...
}
}
Or if we manage to get the @Startup annotation to Commons Annotation :
@Startup
public class MyListenerBean{
@JMSListener(lookup="java:global/java:global/Trades",type=JMSListener.Type.TOPIC )
public void deliver(Message message) {
...
}
}
Just thinking here
Antonio