0 Replies Latest reply on Jul 13, 2015 7:22 AM by Abhishek Singh

    Unable to get HornetQ mapmessage using apache.nms in c#(able to get text messages correctly)

    Abhishek Singh Newbie

      Hello Folks,

       

      I am trying to connect to hornetq and get use apache.nms to retrieve all the messages.With help of Yong Hao Gao from jboss team am able to get the text messages working but stil unable to get mapmessages.It seems apache.nms is designed for ActiveMQ only and we need to tweak to get it working for HornetQ messages.So far,had to edit Apache.NMS.Stomp.Commands.ConsumerId.cs class to replace : with _ before sending the messages and reverting same after receiving messages.The reason behind this is as follows as per Stomp specs:

       

      When creating a subscriber it sends a stomp frame SUBSCRIBE and it has a 'id' header which looks like this:
      id:ID:aps-Dell-W540-54976-635791810153748190-1:0:1:1
      You can see the header has special char ":". In Stomp 1.1 spec, it says:


      "Escaping is needed to allow header keys and values to contain those frame header delimiting octets as values.When decoding frame headers, the following transformations MUST be applied:
      \n (octet 92 and 110) translates to newline (octet 10)
      \c (octet 92 and 99) translates to : (octet 58)
      (octet 92 and 92) translates to \ (octet 92)"

       

      At the moment,with these changes am able to get it working for text messages but map messages still not working.On having a closer look I find that in Apache.NMS.Stomp.Protocol.StompWireFormat.cs class,in

      protected virtual Object CreateCommand(StompFrame frame)

              {

      -----some code----------

                 }

      method,the object in frame object is empty in case of mapmessage while same works fine for text messages

       

      Please help!!!.

       

      Note:This question itself solves starting issue for many c# developers who are trying to connect hornetq but am stuck at the next steps.Thanks Yong for his help to get me upto this point.