lundi 1 juin 2015

What is the correct way to publish a message over JMS topic which has been injected in an EJB from a Netty event loop?

I have a @Singleton EJB which is started at @Startup, this bean listens to multicast traffic using netty. And what I would like to do is, on receipt of a message over multicast, send a JMS message on an injected topic (so on Wildfly, with JMS 2.0, I have the following:)

  @Resource(lookup = "java:/jboss/exported/jms/topic/appUpdates")
  private Topic appUpdate;

  @Inject
  private JMSContext context;

I know there are no problems with the topic and publishing a message if I have a @Scheduled function in the ejb, I can happily create a publisher and send a message. However attempt to publish JMS message from the netty event loop context results in:

2:10:34,441 ERROR [stderr] (nioEventLoopGroup-0-1) java.lang.RuntimeException: javax.naming.NameNotFoundException: java:comp/TransactionSynchronizationRegistry 12:10:34,441 ERROR [stderr] (nioEventLoopGroup-0-1) at org.jboss.as.messaging.deployment.JMSContextProducer$JMSContextWrapper.getDelegate(JMSContextProducer.java:217)

So my question is, what is the correct way to publish from the let's say non-jboss context (Netty event loop) to the JMS topic?

(Server: Wildfly 8.2.0.Final using standalone-full.xml config)

Aucun commentaire:

Enregistrer un commentaire