cancel
Showing results for 
Search instead for 
Did you mean: 

Connection to RabbitMQ

SOLVED
New Contributor

Connection to RabbitMQ

Hello Community Members,

 

I am trying to connect to RabbitMQ from SoapUi to write and retrieve messages for testing dependent services. I searched online for examples to connect to RabbitMQ from SoapUI pro/Ready Api but  cant find any .

 

Can one of you please help . I humbly request for a simple example as well if available which will help me to build cases for my need 

 

Thanking you

Shalu 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: Connection to RabbitMQ

Hi Shalu,

 

Thank you for your post. ReadyAPI supports JMS message testing. RabbitMQ uses AMQP protocol as far as I know which we do not support. However, you can use a Groovy script using the RabbitMQ API to send messages to RabbitMQ. The JAVA doc for RabbitMQ is below.

https://www.rabbitmq.com/api-guide.html

https://www.rabbitmq.com/jms-client.html


Anastasia
Customer Care Team


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓



Join the Ask a SmartBear discussion next Wednesday, February 27th.
We will talk about the biggest test automation gaps!

9 REPLIES 9
Moderator

Re: Connection to RabbitMQ

Hi Shalu,

 

Thank you for your post. ReadyAPI supports JMS message testing. RabbitMQ uses AMQP protocol as far as I know which we do not support. However, you can use a Groovy script using the RabbitMQ API to send messages to RabbitMQ. The JAVA doc for RabbitMQ is below.

https://www.rabbitmq.com/api-guide.html

https://www.rabbitmq.com/jms-client.html


Anastasia
Customer Care Team


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓



Join the Ask a SmartBear discussion next Wednesday, February 27th.
We will talk about the biggest test automation gaps!

Moderator

Re: Connection to RabbitMQ

Hi all,

 

@Nastya_Khovrina thank you for your time looking into this!

 

@shalu, does Nastya's reply answer your question? If so, could you please click the Accept as Solution button below her reply so that other users could find the answer easily in the future?

Thanks in advance.

 

 

Olga Terentieva,
SmartBear Assistant Community Manager

New Contributor

Re: Connection to RabbitMQ

  @Nastya_Khovrina 

 

Thank you!!

Community Expert

Re: Connection to RabbitMQ

Hello @Nastya_Khovrina,

I was wondering if you could clarify something for me:

From RabbitMQ documentation:

RabbitMQ is not a JMS provider but includes a plugin needed to support the JMS Queue and Topic messaging models.

And from ReadyAPI documetation:

You can configure a direct connection to the JMS provider from ReadyAPI without using any additional intermediaries.

So my question is: Can ReadyAPI talk to RabbitMQ that has JSM support enabled? If yes, how?

Also note that HermesJSM has been abandoned sometimes in 2011, and using Java8 (which ships with latest ReadyAPI) it no longer works.

 

Lastly, if anyone is interested: I ported the RabbitMQ tutorials to SoapUI. The MR can be found here; until the merge is accepted, you can find the SoapUI project here.

Moderator

Re: Connection to RabbitMQ

SiKing,

 

In a theory, you should be able to connect if you do the following:

1. Put the JMS client libraries to the ReadyAPI_Install\bin\ext folder. 

2. Create a JMS Server and specify the following settings:

- Initial Context Class

- Provider URL

- Connection Factory JNDI Name

and credentials if needed.

 

So, I have several questions to you:

- Do you have a bindings file?

- Do you have a connection factory?

 


Anastasia
Customer Care Team


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓



Join the Ask a SmartBear discussion next Wednesday, February 27th.
We will talk about the biggest test automation gaps!

Community Expert

Re: Connection to RabbitMQ

So, I have several questions to you:

- Do you have a bindings file?

- Do you have a connection factory?

I have my RabbitMQ enabled for JMS, and I downloaded the vendor JMS file:

INFO: ".../Applications/ReadyAPI-2.5.0.app/Contents/Resources/app/bin/ext/rabbitmq-jms-1.11.0.jar" has been added to the classpath.

Using their documentation I tried various conbinations of javax.jms.ConnectionFactory, com.rabbitmq.jms.admin.RMQConnectionFactory, and com.rabbitmq.jms.admin.RMQObjectFactory, but in every case I only got:

Could not establish a JMS connection: javax.naming.NoInitialContextException:
  Cannot instantiate class: com.rabbitmq.jms.admin.RMQConnectionFactory
  [Root exception is java.lang.ClassCastException: com.rabbitmq.jms.admin.RMQConnectionFactory cannot be cast to javax.naming.spi.InitialContextFactory]

At this point I am not sure what else to try?

Moderator

Re: Connection to RabbitMQ

Hi Siking,

 

I tried with the following settings:

Initial Context Class: com.sun.jndi.fscontext.RefFSContextFactory

Provider URL: file:/C:/Users/<myUserName>/AppData/Roaming/RabbitMQ/

ConnectionFactory JNDI Name: ConnectionFactory

 

And credentials for the "guest" user.

 

But, as far as I understand, you need to have the .bindings or configuration file and the Connection Factory.

 

Also, I placed the following files to the <ReadyAPI_Install>\bin\ext folder:

- providerutil.jar

- fscontext.jar

- amqp-client-3.1.5.jar

- rabbitmq-jms-1.0.5.jar

 

But, it doesn't work on my side. 

 

Since I'm not aware of the RabbitMQ specifics I cannot be helpful here.

 


Anastasia
Customer Care Team


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓



Join the Ask a SmartBear discussion next Wednesday, February 27th.
We will talk about the biggest test automation gaps!

Community Expert

Re: Connection to RabbitMQ

But, as far as I understand, you need to have the .bindings or configuration file and the Connection Factory.

I am not sure what the bindings file is. For comparison I tried to connect to the ActiveMQ as described here, and it works as advertised! There is no mention of a bindings file anywhere.

Moderator

Re: Connection to RabbitMQ

You will need to configure JNDI. This article should be helpful for you: https://knowledge.safe.com/questions/31256/rabbitmq-jms-client-configuration.html

 


Anastasia
Customer Care Team


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓



Join the Ask a SmartBear discussion next Wednesday, February 27th.
We will talk about the biggest test automation gaps!

Ask a SmartBear
Top Kudoed Authors