I have some Camel routes interacting with a 3rd EJB-based app. Currently this is accomplished by acquiring a JMS topic via JNDI and starting the Camel context in a separate VM instance, i.e. running Camel as a regular Java application. This is not really convenient - I'd like to package up Camel and the defined routes in an EJB for J2EE deployment because most of the application is implemented as EJB's and MBeans on JBoss. My concerns are:
Is it even possible? I ask because I'm pretty sure Camel creates it's own threads and maybe uses ThreadLocal internally. I'm no an EJB expert, but I understand that application code should not create it's own threads. I wonder if this is true even in stateless session beans? I already searched around and the only deployment options I've seen discussed are standalone (java app), Spring container and OSGI container - I have found nothing about J2EE deployment. Any ideas? Thanks, -Charles