TomEE can't send messages to ActiveMQ Artemis, but can recieve them. ActiveMQ "Classic" works fine same code

90 Views Asked by At

I am trying to configure TomEE to send messages to ActiveMQ Artemis. I can receive them in an MDB if I send with the ActiveMQ Artemis web console. However statless service (works with ActiveMQ "Classic") doesn't send messages to ActiveMQ Artemis, but it also doesn't show any errors in the logs.

Here is TomEE xml snippets relating to sending messages. I think the issue is either here or with the jars below or TomEE integration:

    <Resource id="MyJmsConnectionFactory"
              class-name="org.apache.activemq.artemis.jms.client.ActiveMQXAConnectionFactory"
              constructor="uri,username,password"
              type="jakarta.jms.ConnectionFactory">
        uri=tcp://localhost:61617?needClientAuth=false;sslEnabled=true;trustAll=true;verifyHost=false;wantClientAuth=false;needClientAuth=false
        username=admin
        password=admin 
    </Resource> 


    <Resource id="TESTQ"
              class-name="org.apache.activemq.artemis.api.jms.ActiveMQJMSClient"
              constructor="name"
              factory-name="createQueue"
              type="jakarta.jms.Queue">
        name=TESTQ
    </Resource> 
    <Container id="mdb" type="MESSAGE">
        InstanceLimit = -1
        ResourceAdapter = MyJmsResourceAdapter
        ActivationSpecClass = org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec
    </Container> 

Here is the injection point int the stateless service:

@ Stateless 
@ Path ( "/RestTest" ) 
public class RestTest
{
    @ Resource ( name = "MyJmsConnectionFactory" )
    private ConnectionFactory _connectionFactory ;

    @ Resource ( name = "TESTQ" )
    private Queue testq ;
    .....
}

I have tried several combinations of ActiveMQ Artemis jars with TomEE 9. Here is what I am currently using:

I have also tried without SSL and normal TCP. It doesn't work. I have tried similar thing on TomEE 8 with javax classes, and the result is the same - only the MDB works.

Any idea how to get TomEE to send messages to ActiveMQ Artemis?

I was expecting message to go from TomEE to ActiveMQ Artemis server

7/21/23 I am able to see artemis get message when turned on more artmeis logging, however client doesn't show as producer in console and message never appears in queue:

2023-07-21 10:27:21,334 DEBUG

[org.apache.activemq.artemis.core.server.impl.ServerSessionImpl] 
Routing result for CoreMessage[messageID=1538,durable=true,userID=b414a064-27d2-11ee-8e7d-00059a3c7a00,priority=4, 
timestamp=Fri Jul 21 10:27:21 EDT 2023,expiration=0, durable=true, address=TESTQ,size=1376,
properties=TypedProperties[__AMQ_CID=b40955c1-27d2-11ee-8e7d-00059a3c7a00,_AMQ_ROUTING_TYPE=1
,_AMQ_DUPL_ID=7e335005-1538-488d-ac5e-0f54ebc01ec8,
_HQ_DUPL_ID=7e335005-1538-488d-ac5e-0f54ebc01ec8]]@1370468351 = OK
0

There are 0 best solutions below