Question
· Mar 4, 2019

Ensemble to Spring Boot Java app using RabbitMQ

I successfully got everything in this guide to work:  https://community.intersystems.com/post/ensemble-rabbitmq-java-client-qu...

I am now using the information I gained from this guide along side with this guide:

https://www.rabbitmq.com/tutorials/tutorial-one-spring-amqp.html

 

I am running into an issue though. In the RabbitMQ guide I just posted, they have a "Receive message" functionality. I use that alongside with the SendMsg from Ensemble method in the InterSystems guide. The issue I have is the message I receive looks like "[B@2c421093(byte[21])" instead of "Hello from Ensemble!".

Unfortunately I have no experience with Object Script or Mumps (so inexperienced I'm not sure which language the HelloWorld.cls is) so I am having trouble figuring out how to successfully send the message "Hello from Ensemble!" instead of "[B@2c421093(byte[21])".

If anyone could help me decipher what exactly is happening in the code and how to alter the message to a string instead of bytes, it would be much appreciated.

 

Thank you!

Discussion (4)0
Log in or sign up to continue

@Eduard Lebedyuk , I am running into an issue when attempting to run the commands in the Cache Terminal.

When typing "S sc=##class(isc.rabbitmq.API).sendMessage()

I get "<METHOD DOES NOT EXIST> *sendMessage,isc.rabbitmq.API"

Also when I created the Java Gateway I got this error

"

 

ERROR #5117: In class 'com.rabbitmq.tools.jsonrpc.JsonRpcException' element type 'Method', element 'getMessage' and 'getmessage' have the same name but differ in case. > ERROR #5030: An error occurred while compiling class 'com.rabbitmq.tools.jsonrpc.JsonRpcException'1
   com.rabbitmq.tools.jsonrpc.JsonRpcException imported."

Some ideas.

1. The problem is isc.rabbitmq.API  class was imported with an error. Delete this class and try this code (post output):

Set class = "isc.rabbitmq.API"
Set classPath = ##class(%ListOfDataTypes).%New()
Do classPath.Insert(PATH-TO-JAR)
Set gateway = ##class(%Net.Remote.Gateway).%New() 
Set sc = gateway.%Connect("localhost", PORT, $Namespace, 2, classPath)
Zwrite sc
Set sc = gateway.%Import(class)
Zwrite sc
Write ##class(%Dictionary.CompiledClass).%ExistsId(class)

2. Try recompiling isc.rabbitmq.API  class.

3. Maybe have 2 amqp jars with com.rabbitmq.tools.jsonrpc.JsonRpcException class.  The only class you should import is isc.rabbitmq.API  class. It shouldn't pull many additional ones.

4. What version of AMQP are you using? I'm using amqp-5.0.0. Try the same verison?