Jess Farmer · Mar 4, 2019

Ensemble to Spring Boot Java app using RabbitMQ

I successfully got everything in this guide to work:

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


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!

1 0 4 282


Thank you @Eduard Lebedyuk , looks very useful. I'm going to see if I can use it to achieve my goal.

@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 '' element type 'Method', element 'getMessage' and 'getmessage' have the same name but differ in case. > ERROR #5030: An error occurred while compiling class ''1 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 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?