Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using JMS connector in WildFly with its embedded ActiveMQ server #2347

Open
jarek-przygodzki opened this issue Oct 25, 2023 · 2 comments
Open
Labels

Comments

@jarek-przygodzki
Copy link

Whats the recommended solution for using JMS connector from within WildFly with its embedded ActiveMQ server?

Using the connector with default ConnectionFactory does not work

@ApplicationScoped
public class JmsConnectionFactory
{
    @Resource ConnectionFactory cf;
    @Produces ConnectionFactory factory() { return cf; }
}

because message acknowledgement fails with

javax.jms.IllegalStateException: Non XA connection
    at [email protected]//org.apache.activemq.artemis.ra.ActiveMQRASession.getSession(ActiveMQRASession.java:1158)
    at [email protected]//org.apache.activemq.artemis.ra.ActiveMQRAMessage.acknowledge(ActiveMQRAMessage.java:71)
    at deployment.mp-reactive-messaging.war//io.smallrye.reactive.messaging.jms.IncomingJmsMessage.lambda$ack$0(IncomingJmsMessage.java:115)
    ... 5 more

What does work is using the remote connection factory (user/password need to be specified in channel config)

@ApplicationScoped
public class JmsConnectionFactory
{
    @Resource(mappedName = "java:jboss/exported/jms/RemoteConnectionFactory") ConnectionFactory cf;
    @Produces ConnectionFactory factory() { return cf;  }
}

However this seems like a kludge. Is there a batter way?

@cescoffier
Copy link
Contributor

\CC @kabir

@kabir
Copy link
Contributor

kabir commented Oct 30, 2023

WildFly does not include the JMS connector from SmallRye Reactive Messaging at this stage. To send to/receive from JMS in WildFly you need to use standard JMS.

However, in WildFly our embedded ActiveMQ supports AMQP, so you might be able to use wildfly/wildfly#16281 once that is merged.

@ozangunalp ozangunalp added the jms label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants