Simplest way to read a Java MapMessage in .NET

I'm replacing an old TibRv system we have where the message producer is a Java application and the message consumer is a .NET application. Using a MapMessage seemed the most natural way to go, since that had a very similar interface to the TibRv libraries we had been using. After porting the Java applications over, it came time to port the .NET clients over. I'm far less comfortable in c# than I am in Java, but its not at all clear to me what the .NET API can do with my MapMessage.
Am I missing something in the documentation ( I hope I am), or do I have to roll my own using the binary payload and the SDTMap in the .NET API?
Thanks,
Jim
Comments
Not sure you have already seen this but it may help. There's an example of how to handle a MapMessage in C#
https://docs.solace.com/Solace-JMS-API/Creating-JMS-Compatible-Msgs.htm#creating_jms-compatible_msgs_1946471526_329687
It seems you can then iterate over the entries in the map using
GetNext
,HasNext
and start over usingRewind
once you iterated over all entries:https://docs.solace.com/API-Developer-Online-Ref-Documentation/net/html/fe47d7d1-f581-1059-d6e8-aaad2c1dc5cb.htm
Thanks. That appears to be what I'm looking for. I'll give it a try. I am not using a JMS MapMessage, but a Solace JCSMP MapMessage. It never occurred to me to look in the JMS API docs.
A JMS MapMessage is under the covers converted to a Solace MapMessage and you can handle is as such as far as I understand. Good luck!
Hi @fijimf ... here's a few other places to check:
SDTPubSubMsgDep.cs
sample located in the "ex" folder:Hope that helps!
Hello - I am working on .Net app, communicating with Java application. Java service is sending a Json response, stated they are sending MapMessage. Below is what I see in container, Is 'm_opaqueContainer' the actual message? If so how do I convert to string to be used in Json deserializer? Also, I was able to extract the message from 'binaryAttachment' of response but it has additional data which is not needed.
thanks in advance.
{SolaceSystems.Solclient.Messaging.Native.SDTMapContainerImpl}
m_isClosed: 0
m_opaqueContainer: {1946161133}
m_unmanagedByteBuffer: {0}
m_unmanagedByteBufferSize: 0