AMQP 1.0 + JMS

82 views
Skip to first unread message

Bogdan Tischenko

unread,
May 31, 2021, 9:01:13 AM5/31/21
to rabbitmq-users
I'm trying to set up RabbitMQ with AMQP 1.0 and consume messages with @JmsListener in Spring Boot.

The JMS plugin page says it's intended to be used with Java JMS Client for RabbitMQ.
The AMQP 1.0 plugin page says it's best used with SwiftMQ Java Client.

Can someone please help me figure out which technology I need to use and how to set it up? I'm very new to all of this. It's a university assignment.

Arnaud Cogoluegnes

unread,
May 31, 2021, 9:34:56 AM5/31/21
to rabbitm...@googlegroups.com
If you're using RabbitMQ AMQP 1.0 plugin and expect to use the JMS API to publish/consume messages, you need a JMS client that can speak AMQP 1.0, that is indeed SwiftMQ or QPid. Note the AMQP 1.0 plugin test suite uses QPid [1].

Then you'll need to configure Spring Boot to use a JMS ConnectionFactory bean from one of these 2 client libraries.

[1] https://github.com/rabbitmq/rabbitmq-server/tree/master/deps/rabbitmq_amqp1_0/test/system_SUITE_data/java-tests

________________________________________
From: rabbitm...@googlegroups.com <rabbitm...@googlegroups.com> on behalf of Bogdan Tischenko <tisch...@gmail.com>
Sent: Monday, May 31, 2021 3:01 PM
To: rabbitmq-users
Subject: [rabbitmq-users] AMQP 1.0 + JMS
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com<mailto:rabbitmq-user...@googlegroups.com>.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/6d24f479-2195-438b-95a9-61d40a3ca3c2n%40googlegroups.com<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Frabbitmq-users%2F6d24f479-2195-438b-95a9-61d40a3ca3c2n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Cacogoluegnes%40vmware.com%7Cf17572d8ee6a48843bee08d924342f2a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637580628823920710%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=xsfyL9j7%2F96h1wBuBm%2F7KOddnkMmM2HJLnZqdiGukhg%3D&reserved=0>.

Bogdan Tischenko

unread,
May 31, 2021, 9:50:43 AM5/31/21
to rabbitmq-users
I'm on it. Thanks!

Bogdan Tischenko

unread,
May 31, 2021, 12:53:44 PM5/31/21
to rabbitmq-users
I can't get it working!

I have this configuration class
@EnableJms
@Configuration
class QConfig {
@Bean
fun jmsConnectionFactory(): ConnectionFactory {
   val factory = JmsConnectionFactory()
   factory.username = "guest"
   factory.password = "guest"
   factory.remoteURI = "amqp://localhost:5672"
   return SingleConnectionFactory(factory)
}
}

Where JmsConnectionFactory is org.apache.qpid.jms.JmsConnectionFactory

I send a message with jmsTemplate.convertAndSend("hello-q", "Hello world message!")
And try to receive it with
@JmsListener(destination = "hello-q")
fun receive(message: String) {
   println("[x] Listener received: $message")
}

Logs and RabbitMQ management say connections are established successfully. However, the sent messages do not appear in the management app.
I tried publishing messages with the management app as well but they do not appear on the screen = they are not caught with @JmsListener
Reply all
Reply to author
Forward
0 new messages