1

We are using Coldfusion utilising the java RabbitMQ Client API to publish messages to a Queue, and then using EasyNetQ to read the messages from the queue using C#.

The message is a string.

The java Client is publishing messages as an unseralized bytearray with a content-type of text/plain.

When we try and read the message from the queue we always get a EasyNetQ.EasyNetQInvalidMessageTypeException thrown, no matter the type of the message as defined on the EasyNetQ side. I have tried it as byte array and just a basic object. I think EasyNetQ is expecting a serialized object every time?

The exception we are getting is

Message: 2344462 BasicProperties: (content-type=text/plain, content-encoding=, headers=, delivery-mode=1, priori ty=0, correlation-id=, reply-to=, expiration=, message-id=, timestamp=, typ e=, user-id=, app-id=, cluster-id=_)

Exception: EasyNetQ.EasyNetQInvalidMessageTypeException: Message type is incorrect. Expecte d 'System_Byte[]:mscorlib', but was ''

Can anyone help please?

Indy
  • 283
  • 1
  • 2
  • 9

1 Answers1

1

EasyNetQ expects a JSON serialized UTF-8 body representing the .NET type given in the subscription method and the 'type' field of basic properties to be populated with a EasyNetQ style type description.

You should use the Advanced API if you want to do your own de-serialization.

Mike Hadlow
  • 9,427
  • 4
  • 45
  • 37